+ 4
How Do I Have a Dropdown menu change a picture on screen?
I am unsure if I am doing this right but this is my first combination of css js and html in one code. I would like to make the drop down menu change the mountain to the desert picture and vice-versa. I dont know how to set up the drop down link to the id of the picture I already have when i run the console. https://code.sololearn.com/WERiM011ezta/?ref=app
4 ответов
+ 2
I would suggest including an id in your img tag and use event.target.text to check for the text in the drop-down list instead of matches.
[edit]I miss read your comments about the drop-down box, so forget the part about instead of matches. I would add another function that has an event parameter to change the image using event.target.text -
https://code.sololearn.com/WI23Q3NT1oSj/#html
+ 3
Hello, Coming In Second !
Please write in more detail, and then people will be able to help you.
+ 1
Alexander Sokolov I updated my description of my conundrum. Does that help alittle?
+ 1
Could I make an id for each drop down then make a function to manipulate the picture on screen?