I have an input element and I want to continue checking the length of the content, and when the length becomes equal to a certain size, I want to enable the submit button, but I encounter a problem with the onchange Javascript event as an event fires only when the input element goes beyond Visibility, not when changing content.
<input type="text" id="name" onchange="checkLength(this.value)" />
---- onchange does not work when the contents of the name change, but only when the name is out of focus.
What can I do to make this event work on changing content? or some other event that I can use for this? I found a workaround using the onkeyup function, but it does not work when we select some content from the browser autocomplete.
I want something that can work when the contents of a field are changed using the keyboard or mouse ... any ideas?
javascript jquery javascript-events dom-events
Sachin Midha Aug 18 2018-11-11T00: 00Z
source share