[Solved] jquery onchange not working on two method i’ve tried


Why not just call val() in your change handler?

dateselect = $(this).val();  

$(function() {
    dateselect = $('#dateselect').val();
    $('#dateselect').on('change', function() {              
        dateselect = $(this).val();  
        alert(dateselect);
    });
    alert(dateselect);
});

JSFiddle Link

10

solved jquery onchange not working on two method i’ve tried