I used the radio check to change the image.
Here is my html file.
The is the webpage has a boy image. I want to change the image of eye, mouth and nose.
As we can see, the image should be changed when I check another radio. I put the "onclick=" to call the javascript function.
Each function has two var. "var ~Radio" is for array to get Node from html file. "var ~Image" includes the node from <img> in html.
First radio option will be located in the first variable in array. if((var).checked) figures out which radio we check on the html file. Following that, I change the source of <img>.
'Web Programming ๐ > Front-End ๐ฆธ๐ปโโ๏ธ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Javascript OOP in RSVP website project (0) | 2023.04.26 |
---|---|
Javascript Event Exercise to Move Picture (0) | 2023.04.15 |
Javascript Event Object, Apr/10/2023 (0) | 2023.04.11 |
Javascript Events, Apr/08/2023 (0) | 2023.04.09 |
Javascript Event Handling, Apr/5/2023 (0) | 2023.04.06 |