jquery select box help needed -


i have select box , option value has

united kingdom united states

when select "united kingdom" option want 2 values "uk" selected value , param value 1

any possiblity using jquery?

you use .data() function. first have set data on select options.

<option data-country="uk" data-value="1" selected="selected"></option> 

then can data doing following:

$("option:selected").data("country"); $("option:selected").data("value"); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -