No event is getting fired on changing the dropdown value. Please, can someone tell me where I can be going wrong?

JS code

jQuery(document).ready(function($){
    jQuery('#_ccounts select').on('change', function(){
        var acc = jQuery(this).val();
        alert(acc);
    });
});

Html Code

    <label for="_accounts">Accounts</label>
    <select id="_accounts" name="accounts">
    <option value="" disabled="disabled" selected="selected">Select an account..</option>
    <option value="1">abc</option><option value="2"DEF</option>               </select>

Read more here: Dropdown onchange event not getting fired at all in WordPress


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: