Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

disabling first item in dropdownlist

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select name="clientName" id="clientName"> 
    <option name="" value="">Client Name</option>
    <option name="Jennifer Black" value="0">Jennifer Black</option>
    <option name="Henry Johnson" value="1">Henry Johnson</option>
    <option name="Jack Hunnington" value="2">Jack Hunnington</option>
    <option name="Mary Green" value="3">Mary Green</option>
</select>
 $('option[value=""]').attr("disabled", "disabled");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #disabling #item #dropdownlist
ADD COMMENT
Topic
Name
8+4 =