0
Why js is not working when I put it on my file code
When I put the js code on my html file is not working I tried more than once and looked about spelling and it's true??
9 Réponses
+ 1
There seem to be a couple things wrong -
Firstly, you seem to have separated the string within the onclick event and the actual <button> tag, placing them on different lines, so if you just join them together it should be okay.
As for the actual onclick event, the function you're trying to use should be document.getElementById, and rather than making html in innerHTML lowercase, try to keep it capitalized (like how I just typed it). The last thing is that you should try and avoid using double quotes inside single quotes, so rather than setting the innerHTML string within double quotes, set it within single ones ( ' ' )
+ 1
What code are you having troubles with?
+ 1
شكرا
+ 1
The onclick attrib in html, should be returning a function...
Eg
<button onclick="functionName();">btnName</button>
Js
function functionName() {
alert("nothing happened loool");
}
0
Documents.getbyid() isn't work
0
And others code
0
Do you have the link to the code you're having troubles with? It'd be easier to help debug your program with a full understanding of what you're trying to do
0
This is👆🏻👆🏻👆🏻