84
rated 0 times
[
87]
[
3]
/ answers: 1 / hits: 25849
/ 6 Years ago, wed, july 11, 2018, 12:00:00
I'm pretty new to Javascript and playing around with it at the moment. However, I can't actually test my code because I get the following error:
Uncaught TypeError: namecaller is not a function
at HTMLButtonElement.onclick (Tools.html:101)
Here is my code:
div id=content>
<script>
function namecaller(){
var a = scurvy;
var b = dog;
document.getElementById(namecaller).innerHTML = You are a + a + + b;
}
</script>
Namecaller</p>
<button type=button onclick=namecaller()>
You are a...</button>
I have no clue why it doesn't work, looked at other StackOverflow questions and also at the W3 tutorials.
More From » html