0
I can't figure out how to use the getElementById code in JavaScript Code Playground, I've tried multiple times and watched YT
I tried multiple times even watching videos and I still wasn't getting through it was only errors, I tried everything also, I saved and came back, no luck, I copied and pasted from a Sololearn lesson, and still no luck, I don't know if it is a 2025 bug which makes no sense and I haven't reached far in Javascript so I don't know any other codes so please if someone wants to explain or give me and example with comments or basic introduction to Javascript example I would gladly appreciate it.
6 Antworten
0
Rondell Nagassar Check if you're doing it this way:
https://sololearn.com/compiler-playground/WUz55HD6X4AQ/?ref=app
EDIT: Lisa mentioned a great point I didn't. The code in JS tab of code playground runs before/parallel with the HTML code.
+ 3
Show
your
code.
You can only access the HTML element with Javascript when the body is fully loaded. Wrap your Javascript in
window.onload = () => {
...
}
+ 1
Rondell Nagassar My code used internal JS which would work fine. Still, updated the code with seperate JS!
0
Lisa, Okay I'll post a code with it just now
0
Afnan Irtesum Chowdhury, I'll try this just now, but can you make the JavaScript update the words in the example please?
0
Okay, guys, I got it just now, I looked at the codes and noticed that I was using extra brackets() where it wasn't needed, Thank you both for your time I do appreciate it! Afnan Irtesum Chowdhury and Lisa.