<html> <head> <script type="text/javascript"> window.onload = function(){ myFunction = function(){ console.log("1"); } } </script> </head> <body> Enter your name: <input type="text" id="fname" oninput="myFunction()" onpropertychange="myFunction()"> </body> </html>
<html> <head> <script type="text/javascript"> window.onload = function(){ myFunction = function(){ console.log("1"); } var oTest = document.getElementById('fname'); if(oTest.attachEvent){ oTest.attachEvent('onpropertychange',function(){ console.log("1"); }); } else{ oTest.addEventListener('input',function(){ console.log("1"); } ); } } </script> </head> <body> Enter your name: <input type="text" id="fname"> </body> </html>
<html>
<head>
<script type="text/javascript">
window.onload = function(){
myFunction = function(){
console.log("1");
}
}
</script>
</head>
<body>
Enter your name: <input type="text" id="fname" oninput="myFunction()" onpropertychange="myFunction()">
</body>
</html>