Count: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<html> <DIV ID="counter">Number of clicks = 0</DIV> <FORM> <INPUT TYPE="button" VALUE="Increment Counter" onclick="updateMessage()"> </FORM> <SCRIPT LANGUAGE="JavaScript"> <!-...") |
m (Text replacement - "<! —" to "<!--") |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
<DIV ID="counter"> | <DIV ID="counter">Total: </DIV> | ||
<FORM> | <FORM> | ||
<INPUT TYPE="button" VALUE=" | <INPUT TYPE="button" VALUE="+" onclick="updateMessage()"> | ||
<INPUT TYPE="button" VALUE="-" onclick="clearHits()"> | |||
</FORM> | </FORM> | ||
<SCRIPT LANGUAGE="JavaScript"> | <SCRIPT LANGUAGE="JavaScript"> | ||
<!-- | <!-- | ||
var hits = 0; | var hits = 0; | ||
function updateMessage() { | function updateMessage() { | ||
hits += 1; | hits += 1; | ||
document.getElementById("counter").innerHTML = " | document.getElementById("counter").innerHTML = "Total:" + hits; | ||
} | } | ||
// --> | function clearHits() { | ||
hits = 0; | |||
document.getElementById("counter").innerHTML = "Total:" + hits; | |||
} | |||
// --> | |||
</SCRIPT> | </SCRIPT> | ||
</html> | </html> |
Latest revision as of 11:22, 10 December 2022
Total: