+ 1
Dont know the Error
Just look at the Javascript of this code https://code.sololearn.com/WM13v7WVrqb7/?ref=app
10 Antworten
+ 1
Document wird klein geschrieben, auf innerHTML folgt ein = und keine Klammer. innerHTML ist eine Eigenschaft von HTMLElement, keine Funktion.
+ 18
i wrote a comment, look
+ 5
1. change function name from "click()" to anything else, may be click is already preserved keyword or something.
2. use small 'd' in document, instead of Document.
3. innerHTML is not a function, so don't use parantheses, it should be:
document.getElementById("Knorpf").innerHTML=x++;
+ 2
You're welcome. I usually write in English, but your code looked like German (Knopf :D) so I figured I could answer in German and make it a bit easier for you
+ 2
Javascript is case sensitive language...Document !=document.The event for button click is onClick()..you did not even put semi color after declearing variable..document.getElementById("example").innerHTML=count_variable++; as inner.HTML is not function.If applied should run fine
+ 1
Thanks to all guys but special for you Splitty Dev, , because youve written in German and thats my mother language
+ 1
@Sunil Thakali, HTML is case insensitive, so onclick or onClick doesn't make a difference. The onClick function in Javascript is a custom one, not a case sensitive event handler, so that doesn't cause problems either. Also, semicolons are optional in most cases, there are actually very few cases where a semicolon is needed.
+ 1
did you read carefully my comment carefully...i said javascript is case sensitive so do not use Document instead of document.i said the event handler is onclick.not click.usually we use camel case for better readibility..and where do you not use semicolon for declearing variables in javascript..
+ 1
Take a look at https://standardjs.com
Few people know this, but you can write Javascript code without semicolons in the vast majority of cases. You can declare a variable just fine without using a semicolon.
+ 1
tx for great info..i must have been using semi-standard up to now...