![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I encoutered a problem which almost drove me crazy, but let me skip my personal problem, and show you this really strange problem. msdn.microsoft.com told me that selected is a boolean attribute with "false" as its default value.However, unfortunately, I found that not only "selected" was "true" when I assigned "false" to it, but also remained "true" all the time even when I tried to change it to "false". here go the codes: body form select option id="op" value="initialValue" selected="false">op</option select> </form |
|
script function fun(){ op.value="modifiedValue"; var bool=(1==2); op.selected=bool; alert("op.selected is "+op.selected + " op.value is "+op.value); } fun(); /script /body |
![]() |
| Thread Tools | |
| Display Modes | |
| |