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

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -