Currently, I have a simple Javascript counter function:
<body>
<script type="text/javascript">
var clicks = 0;
function onClick() {
clicks += 1;
document.getElementById("clicks").innerHTML = clicks;
};
</script>
<button type="button" onClick="onClick()">Add One To Chain</button>
<p>Chain: <a id="clicks">0</a></p>
</body>
Now, I want to display different text messages to the user at various count points.
For example, when the counter hits 10, it should say hello. At 20, it could encourage the user to keep going, and at 30 - STOP! and so on.
I would appreciate any assistance with this task!