value of select elements with “e.value” vs “e.options[e.selectedIndex].value”

后端 未结 2 470
一向
一向 2021-01-06 06:22

Given the HTML:


                        
    
提交评论

  • 2021-01-06 06:41

    Some old (~2005) threads from the comp.lang.javascript newsgroup, as well as their FAQ [1], mention that .value access was not supported in Netscape Navigator 4 (i.e. pre-2000), and some other mobile and desktop browsers that were considered "old" even at that time.

    Conclusion (backed by @Oriol's DOM spec excerpts): It's totally safe to use today.

    0 讨论(0)
  • 提交回复
    热议问题