javascript - Jquery selectbox make option - links -


js:

   $('#user').selectbox({            onopen: function (inst) {                console.log("open", inst);            },            onclose: function (inst) {                console.log("close", inst);            },            onchange: function (val, inst) {             console.log(val);             },            effect: "fade"        }); 

html:

  <select id="user">                                         <option><?= $user_name ?></option>                                         <option>                                             <a href="/">profile</a>                                         </option>                                         <option>                                             <a href="/">exit</a>                                         </option>                                     </select> 

i want make options of jquery selectbox link, not text, how put link inside option using plugin>

if may suggest solution:

$('#user').change(function() {     window.location.href = $(this).val(); }); 

and option:

<option value="http://www.google.com" >profile</option> 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -