Answer:
function myFunction() {
myNumber = Math.floor(Math.random() * 100) + 1 ;
var values = ["Number is even", "Number is odd"] ;
var stringNum = " ";
if (myNumber % 2 === 0){
stringNum += values[0];
} else {
stringNum += values[1];
document.getElementById("demo").innerHTML = stringNum;
}
Explanation:
The javascript source code is used by the browser to make the web application interactive, making a clickable event for the button to generate an H1 header for the web page.
The myFunction is assigned to an onclick event of a html button tag to display if a random number between 1 and 100 is even or odd.