javascript - Modify Select2 search box -


i using ajax feature of select2 control load options asynchronously. however, change default template of search box have placeholder , icon on right.

is there proper way that?

enter image description here

placeholder: example:

$(".js-example-placeholder-single").select2({   placeholder: "select state",   allowclear: true }); 

custom icon:

you can append using js. create dom element, append want , style css. of course can add additional functionality if needed.

http://www.w3schools.com/jsref/met_node_appendchild.asp


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -