In IE browser, it is useless to set the Disable property for select options.
A certain means must be adopted to solve the problem. The principle, of course, is to remember the option that was last selected.
This.selectedindex came in handy.
Need to refresh to see the effect, because the output is text, there is no JS load situation.
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <ptml xmlns=" http://www.w3.org/1999/xhtml "> <pead> <title> using jquery to resolve option disable attributes that IE does not support & lt;/title> <meta http-equiv= "Content-type" content= "text/html"; charset=gb2312 "/> <script src= http://img.jb51.net/jslib/jquery/jquery-1.3.2.min.js" type= "Text/javascript" ></script> <script> $ (document). Ready (function () {$ (". Myselect option:disabled"). CSS (' color ', ' #CCC ' ); $ ('. Myselect '). Change (function () {if (this[this.selectedindex].disabled) {This.selectedindex = this.s| | 0; }else{THIS.S = this.selectedindex| | 0; }}) </script> </pead> <body> <p> using jquery to resolve IE unsupported option disable Properties </p> General: < select> <option> 1th </option> <option disabled= "Disabled" > 2nd item </option> <option > 3rd </option> <option disabled= "Disabled" > 4th </option> <option > 5th </option> <option > 6th Item </ option> </select> comparison 1: <select class= "Myselect" > <option> 1th </option> <option disabled= "Disabled" > 2nd </option> <option> 3rd item </option> <option disabled= "Disabled" > 4th </option> <option > 5th </option> <option > 6th Item </option> </select> comparison 2: Select class= "Myselect" > <option> 1th </option> <option disabled= "Disabled" > 2nd item </OPTION&G T <option> 3rd </option> <option disabled= "Disabled" > 4th </option> <option > 5th </opt ion> <option > 6th </option> </select> <p >dev by Cssrain, of course you are interested, can also be encapsulated into plug-ins. Remember to send me a copy OH. </p> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]