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
Post a Comment