问题描述:

This question already has an answer here:

  • HTML form readonly SELECT tag/input

    37 answers

网友答案:

Disable all but the selected option:

<select>
<option disabled="disabled">1</option>
<option selected="selected">2</option>
<option disabled="disabled">3</option>
</select>

This way the dropdown still works (and submits its value) but the user can not select another value.

网友答案:

add disabled class:

.disabled{
   color: grey;
}

if class present use prevent default on focus and on click, and dbl click:

$('#el').bind('click dblclick focus').function(event){
   if ($(this).hasClass('disabled')) event.preventDefault();
});
相关阅读:
Top