I am attempting to make a button that when clicked outputs an integer from 1-11. I have tested the "getRandomInt" function and it works, however when I try to add the button aspect nothing comes up when I click the button. Also the console does not log any errors. code:
<form>
<input type="button" onclick="getRandomInt()" value="Click Here">
<br>
</form>
<script type="text/javascript">
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
};
document.write(getRandomInt(1, 12));
</script>
Can someone explain it in layman's terms how to fix this because the function should be correct, I think the button is wrong somehow and I think the two aren't being connected properly.