![]() |
![]() ![]() |
![]() |
msucimaster |
![]()
Post
#1
|
Newbie ![]() Group: Members Posts: 11 Joined: 29-April 20 Member No.: 27,307 ![]() |
I want to show a picture when an entry in a select box an entry is selected. It should be shown immediately as it is meant as a help for people to choose the right option. So I need to know which events are generated that I can use.
The selected box has multiple rows (size=4). Can someone help me with this information? |
pandy |
![]()
Post
#2
|
🌟Computer says no🌟 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 20,737 Joined: 9-August 06 Member No.: 6 ![]() |
onchange for the SELECT. The value for SELECT is the value of the chosen option.
CODE function getOption(x) { alert(x); } HTML <select onchange="getOption(this.value);"> <option selected>Choose a Pet</option> <option value="dog">Dog</option> <option value="cat">Cat</option> <option value="parrot">Parrot</option> </select> Note that the returned value is that of the value attribute, not what's visible on the page. So if the first option is chosen 'dog' not 'Dog' will be returned. |
msucimaster |
![]()
Post
#3
|
Newbie ![]() Group: Members Posts: 11 Joined: 29-April 20 Member No.: 27,307 ![]() |
Thank you.
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 11th June 2024 - 07:04 AM |