I have a select
field with some options in it. Now I need to select one of those options
with jQuery. But how can I do that when I only know the
For me the following did the job
$("div.id_100").val("val2").change();
case sensative
. You can change your select box dynamically as follows,$("div#YOUR_ID").val(VALUE_CHANGED).change();
//value must present in options you selected otherwise it will not work
a simple answer is, at html
<select name="ukuran" id="idUkuran">
<option value="1000">pilih ukuran</option>
<option value="11">M</option>
<option value="12">L</option>
<option value="13">XL</option>
</select>
on jquery, call below function by button or whatever
$('#idUkuran').val(11).change();
it simple and 100% works, coz its taken from my work... :) hope its help..
This Works well
jQuery('.id_100').change(function(){
var value = jQuery('.id_100').val(); //it gets you the value of selected option
console.log(value); // you can see your sected values in console, Eg 1,2,3
});