jquery - Change multi select plugin placeholder -


i using http://wenzhixin.net.cn/p/multiple-select/ multi-select,filter select box. works fine, 1 thing feel difficult have different select boxes , each select box need different placeholder. initiating

<script type="text/javascript">     $(".multi-select-filter").multipleselect({         filter:true,         width:"100%",         placeholder : "select zone(s)"     }); </script> 

this repeating in pages. there way, can make call in common js file , change or override place holder value in individual pages?

you can use attribute on each element place required placeholder message <select class="multi-select-filter" placeholder="some message"></select> in common file

$(".multi-select-filter").each(function () {     $(this).multipleselect({         filter: true,         width: "100%",         placeholder: $(this).attr('placeholder')     }); }) 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -