<!DOCTYPE html>
<html>
<body>
Number: <input type="number" id="myNumber" value="2">
<p>Click the button to change the default value of the number field.</p>
<button type="button" onclick="myFunction()">Try it</button>
<p><strong>Note:</strong> input elements with type="number" are not supported in IE 9 and earlier versions.</p>
<script>
function myFunction() {
document.getElementById("myNumber").defaultValue = "16";
}
</script>
</body>
</html>