Saturday, September 25, 2010

jQuery value and text of selected option in selectbox

You often need the value and text of the selected option of a select box. $("#selectboxid").val() returns the value of the selected option and $("#selectboxid :selected").text() returns the text.

Solution found at:
http://marcgrabanski.com/articles/jquery-select-list-values

No comments:

Post a Comment

Post a Comment