I have been trying to figure a way to round the value of a number onchange event. Just not working..
<html>
<head>
<script type="text/javascript">
function round(x)
{
var y=document.getElementById(x).value
document.getElementById(x).value=y.Math.round()
}
</script>
</head><body>Enter your name:
<input type="text" id="fname"
onchange="round(this.id)"></body>
</html>
<html>
<head>
<script type="text/javascript">
function round(x)
{
var y=document.getElementById(x).value
document.getElementById(x).value=y.Math.round()
}
</script>
</head><body>Enter your name:
<input type="text" id="fname"
onchange="round(this.id)"></body>
</html>