Reputation: 23
I want to make random numbers with html Is there any way for this? the function of java script for this is .random(); but I want just use html
Upvotes: 2
Views: 178
Reputation: 6145
HTML is just a way of describing the content and layout of a page. In order to add dynamic content or interactivity, it is necessary to use JavaScript.
In this instance:
window.onload = function() {
document.getElementById("random-number").innerHTML = Math.random();
};
<div id="random-number"></div>
Upvotes: 0