Show me the biggest number that the user enters in an input box and then display it back to them. I need some improvements to my code, ideally making it possible with just one input box instead of two.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
text-align: center;
}
</style>
</head>
<body>
<h1>Maximum Number Finder</h1>
<input id="numberInput" placeholder="Enter a number" type="number">
<button onclick="findMaxNumber()">Find Max Number</button>
<div id="displayResult"></div>
<script>
const numberInput = document.getElementById('numberInput');
const displayResult = document.getElementById('displayResult');
function findMaxNumber(){
const element = document.createElement('div');
const num = numberInput.value;
if (num){
element.innerHTML= `The maximum number is ${num}`;
displayResult.appendChild(element);
}
}
</script>
</body>
</html>