Click event on select option element in chrome Click event on select option element in chrome google-chrome google-chrome

Click event on select option element in chrome


I don't believe the click event is valid on options. It is valid, however, on select elements. Give this a try:

$("select#yourSelect").change(function(){    process($(this).children(":selected").html());});


We can achieve this other way despite of directly calling event with <select>.

JS part:

$("#sort").change(function(){    alert('Selected value: ' + $(this).val());});

HTML part:

<select id="sort">    <option value="1">View All</option>    <option value="2">Ready for Review</option>    <option value="3">Registration Date</option>    <option value="4">Last Modified</option>    <option value="5">Ranking</option>    <option value="6">Reviewed</option></select>


The easy way to change the select, and update it is this.

// BY id$('#select_element_selector').val('value').change();

another example:

//By tag$('[name=selectxD]').val('value').change();

another example:

$("#select_element_selector").val('value').trigger('chosen:updated');