I have a input element that has a keyup event, any number greater than will show a div.
This works if a human types into the textfield. However, how do I achieve the keyup on page load if I am setting the value via JS?
<input id="this_field">
JS on page load:
$('#this_field').val('4'); //Now I want the keyup to be event to be triggered.
I know I can wrap the keyup in a function and call it right after setting the value, however is there a way to trigger the keyup?
Make use of
$(document).Ready()andtrigger()of jquery .