HTML Clicker Counter Example: Simple Code Tutorial
<!DOCTYPE html>
<html>
<head>
<title>Clicker Example</title>
<script>
var count = 0;
function incrementCount() {
count++;
document.getElementById('counter').innerHTML = 'Count: ' + count;
}
</script>
</head>
<body>
<h1>Clicker Example</h1>
<button onclick='incrementCount()'>Click Me!</button>
<p id='counter'>Count: 0</p>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/lsuT 著作权归作者所有。请勿转载和采集!