<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="" method=post>
<input type=text name=id>
<?
echo"<input type=text name=nop><input type =button value ='Pembulatan' onClick =this.form.nop.value='$pembulatan'>";?>
</form>
</body>
</html>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="" method=post>
<input type="text" name="id" id="id"/>
<input type="text" name="nop" id="nop"/>
<input type="button" value ='Pembulatan' onClick="document.getElementById('nop').value = bulat();"/>
</form>
<script type="text/javascript">
function bulat(){
var input = document.getElementById('id').value;
var panjang = input.length;
var bulat = input.substring(panjang - 4)+'000';
}
</script>
</body>
</html>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="" method=post>
<input type="text" name="id" id="id"/>
<input type="text" name="nop" id="nop"/>
<input type="button" value ='Pembulatan' onClick="document.getElementById('nop').value = bulat();"/>
</form>
<script type="text/javascript">
function bulat(){
var input = document.getElementById('id').value;
var panjang = input.length;
var bulat = input.substring(panjang - 4)+'000';
return bulat;
}
</script>
</body>
</html>