I need to verify myFunction to run at the time of onblur
event. I tried below but didn't work.
HTML form:
<div class="header1">
<input type="text" id="ename" onblur="myFunction('ename')" name="name" placeholder="Enter Employee ID" required="" />
</div>
JavaScript: code
<script>
function myFunction('id') {
var x = document.getElementById('id');
if (x === parseInt(x, 10))
alert("data is integer")
else
alert("data is not an integer")
}
</script>