The best website in the world
You Pressed the Button 0 times
Code:
<head>
<meta "charset = UTF-8" />
<title> TestWebSite </title>
</head>
<body>
<p> The best website in the world </p>
</body>
<body>
<input type ='button' value = 'Count' id = 'buttCount'/>
<p>You Pressed the Button <span id = 'output'>0</span> times</p>
<p>Highest Count: <span id = 'output2'>0</span> times</p>
</body>
<Script type = 'text/javascript'>
var count = 0;
var max = 0;
var button = document.getElementById("buttCount");
var display = document.getElementById('output');
var display2= document.getElementById('output2');
button.onclick = function(){
count ++;
if(max<count){
max = count;
}
display.innerHTML = count;
display2.innerHTML = max;
}
</Script>