I am working on a script that changes the span text value depending on user input in the select menu.
I have a fault with my current script. How do I fix it so when I cl
You need to determine the selected option and then the text inside that option.
$(function() { $('#usertype').change(function() { var selectedText = $("#usertype option[value='"+ $(this).val() +"']").text(); $(this).next("span").text(selectedText); }); });
Check out this jsfiddle JSFIDDLE