To demonstrate what I want to do I use an example from W3schools here in codepen.
I have a text box that has a keyup
event listener, with each character you enter it refines your search.I want to fill the textbox with text using value
property of it and then trigger the keyup event so that the keyup event listener runs.
But I couldn't get anything to do just that.
I want to use core JS but to test it I tried it with jQuery too but no luck.
$('#mySearch').val("j");
$('#mySearch').keyup();