I need to call a function myFunc()
upon changing the value of the input field to the same text as before and for some reason for my test case I don’t want to use onBlur()
event.
For Example:
<html>
<body>
Enter your name: <input type="text" id="fname" onchange="myFunc()">
<script>
function myFunc() {
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
</body>
</html>
Here first I give the input “Martin” it calls the function, now again if I type “Martin” I need to call that function.