15 AnswersNew Answer
15 AnswersNew Answer
Nazeekk I managed to make it work, thanks for the help. idk why it didn't work.
Have a look at this example: https://code.sololearn.com/WXr5wf0KLFfe/?ref=app For using innerHTML and it works normally you have to use a script tag in html or onload the js in the js section (a window onload). Bcs if you don't use this method it comes error. It happened with me many times too, but I hope now you understand. For more add more details or the code. Happy coding :)
GabrieleYT9768 How did you try?
Tell more details🤔🤔
GabrieleYT9768 Smth like "document.getElementById("test").innerHTML = "text" ??
Nazeekk and I Am AJ ! I tryed with a function who had to change an empty paragraph but it didn't work
I think.. that's have to work🤔🤔
Nazeekk It's what i did and it didn' t work. i tried to use vars too, i tried to create one outside the function and inside but both didn't work. idk what to do, i need this function.
before you post the exact code we cqnt hwlp you
I think.. maybe thats just because you use SoloLearn editor. Try to use "Brackets" or "VisualCode"
John Doe I'll make it
Nazeekk I did it, it's from a lot of time that it doesn't work
Alyagout Babo What tf do you mean?
<!DOCTYPE html> <html> <head> <title>Image selector viewer [demo for @Carl Moore]</title> </head> <body> <h1>Image selector viewer</h1> <h2>basic demo for @Carl Moore</h2> <p>Using <iframe> for that purpose is too much heavy for nothing ^^ Just target an <img> element instead, or even whatever element styled with a css background image...</p> <select onchange="setimg(this);"> <option></option> <option value="http://www.laboiteverte.fr/wp-content/uploads/2015/03/boucle-gif-geometrique-03.gif">image 1</option> <option value="http://www.laboiteverte.fr/wp-content/uploads/2015/03/boucle-gif-geometrique-02.gif">image 2</option> <option value="http://www.laboiteverte.fr/wp-content/uploads/2015/03/boucle-gif-geometrique-01.gif">image 3</option> </select> <img id="out"> </body> </html>
Sololearn Inc.4 Embarcadero Center, Suite 1455
Send us a message