Search code examples
jquerykeyup

keyup does not read input value


I've noticed that keyUp in JQuery does not read the input value if the user selects an entry that was previously saved before.

For example in the image below...

enter image description here

If the user picks the previously saved entry, then my keyUp function will only read up to 13 in the image above, instead of 13eb@queensu.ca. keyUp will only work if the user enters every character of the email manually. How can I fix this issue?


Solution

  • you can combine using this.

    $('#text').on('change keyup mousedown',function(){
    alert("1");
    });
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <input type="text" id="text"/>