I\'ve got a problem making a click
event on an HTML option
element work.
Even a simple console.log(\'hello!\');
won\'t work.>
Sample example will show how to change dropdown values and color for the OPTION on click or change of select
HTML:
jQuery:
$("select").on("click", function () {
debugger;
var sVal = $(this).val();
$(this).css("background-color", "red");
$(this).find("option").css("background", "white");
$(this).find('option:selected').css("background-color", "red");
$("input").val($(this).val());
});
Demo