Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

<option>  RSS feed

 
FY Hsieh
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inside <select> tag I can have some <option> items. Is there a way for me to specify that a specified <option> is not selectable, i.e. when user selects this <option> item, there is no reaction from screen. This is different from disabling the entire <select>.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66143
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there's the <optgroup> element, but I don't think that's what you are after.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some browsers support disabled on an option, by most do not. Best bet is to remove it.

Eric
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!