<html>
<body>
<p id="demo">Click the button to display a random number between 1 and 10.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var x=document.getElementById("demo")
x.innerHTML=Math.floor((Math.random()*10)+1);
}
</script>
</body>
</html>