button :o
This commit is contained in:
parent
f2ac0e66c2
commit
670342a65f
12
index.html
12
index.html
@ -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>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user