jquery set dropdown selected value by id code example

Example 1: how to set dropdown value in jquery

$("#comboboxid").val(yourvalue).trigger("chosen:updated");

Example 2: jquery dropdown selected value show field

jQuery(document).ready(function() {
    jQuery("#carm3").change(function() {
        if (jQuery(this).val() === 'other'){ 
            jQuery('input[name=other_interest]').show();   
        } else {
            jQuery('input[name=other_interest]').hide(); 
        }
    });
});

Example 3: jquery set select value

$("div.id_100 select").val("val2");

Tags:

Html Example