New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Can anyone tell me why it is not working as I am new in js
8 Answers
+ 3
You have declared
document.getElementById("btn")
.addEventListener("click", function () {...}
In the line 47.So you must declare the id="btn" in that specific button to get access with that button.
Here's a demo example:
https://code.sololearn.com/WoBkijJ2shIs/?ref=app
+ 1
It's working fine in my device.
What's wrong on your side?
+ 1
which line you have declared the btn id in your code html ?
0
A͢J it's not working on pc
0
I want to make it work here
https://code.sololearn.com/WA19A2a25A21/?ref=app
0
The future is now thanks to science[In a break] I had not declared it I just wrote button type button there and in the slider I had declared only button onlick
0
Harshita Kumari
Why you didn't share original code? It is your mistakes not our. Your previous shared code was working fine.
You still have many mistakes. There is no id 'btn' and 'text'