SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: alert option value
-
Apr 15, 2007, 14:10 #1
- Join Date
- Dec 2005
- Posts
- 527
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
alert option value
hi
This is my code :
Code:<select onChange(alert(Selected option ID)) > <option id="1">One</option> <option id="2">Two</option> </select>
-
Apr 15, 2007, 14:34 #2
- Join Date
- Aug 2006
- Posts
- 266
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<select onChange="alert(this.options[this.selectedIndex].id)" > <option id="o1">One</option> <option id="o2">Two</option> </select>
Code:<select onChange="alert(this.options[this.selectedIndex].getAttribute('id'))" > <option id="o1">One</option> <option id="o2">Two</option> </select>
Last edited by muazzez; Apr 16, 2007 at 08:29.
Bookmarks