HTML form readonly SELECT tag/input

前端 未结 30 2361
陌清茗
陌清茗 2020-11-22 08:28

According to HTML specs, the select tag in HTML doesn\'t have a readonly attribute, only a disabled attribute. So if you want to keep

30条回答
  •  孤街浪徒
    2020-11-22 09:07

    Yet another more contemporary option (no pun intended) is to disable all the options of the select element other then the selected one.

    note however that this is an HTML 4.0 feature and ie 6,7,8 beta 1 seem to not respect this.

    http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/OptionDisabledSupport.html

提交回复
热议问题