button :o

master
Caleb Fontenot 2023-03-07 18:22:00 +07:00
parent f2ac0e66c2
commit 670342a65f
1 changed files with 11 additions and 1 deletions

@ -31,6 +31,15 @@
<p>Hi! My name is <mark>Caleb Fontenot.</mark> I am a software developer in my second semester at South Lousiana Community College.</p>
<script type="text/javascript">
var timesClicked = 0;
function clickCount() {
timesClicked++;
if (timesClicked == 1) {
document.getElementById("theButton").innerHTML = "You've clicked me 1 time.";
} else {
document.getElementById("theButton").innerHTML = "You've clicked me " + timesClicked + " times.";
}
}
function main() {
var array = new Array(10);
@ -57,10 +66,11 @@
console.log(typeof(array[i]));
}
document.getElementById("jsOutput").innerHTML += ("JavaScript is an absolutely bizarre language.");
clickCount();
}
</script>
<button class=button onclick="main()">Click me!</button>
<button id="theButton" class=button onclick="main()">Click me!</button>
<p id="jsOutput"></p>