deadpool42
Programmer
- May 24, 2004
- 40
This is the code I have right now to check the value of a list:
The problem is that this doesn't work until someone actually clicks the element. I want to check its value in the body's onLoad event. Any tips?
Code:
var selected = document.getElementById('id').selectedIndex;
var option = document.getElementById('id').options[selected].value;
The problem is that this doesn't work until someone actually clicks the element. I want to check its value in the body's onLoad event. Any tips?