when you select one of the options, this script alerts the “text” and “value” properties of the option that was selected. however, “text” always returns “undefined” using the code below UNLESS i use the absolute DOM value to access it…?!?!?!? what! why??
[code]<script type=”text/javascript”>
function update(obj)
{
alert(obj.text) // undefined
alert(document.stores.city.options[1].text) // works fine
alert(obj.value) // works fine
alert(document.stores.city.options[1].value) // works fine
// since the bottom two work, shouldnt the top two also work!??!
}
</script>
<form name=”stores”>
<select name=”city” onchange=”update(this)”>
<option value=”1″>KMART</option>
<option value=”2″>SEARS</option>
</select>
</form>
i only tested this in IE