user3103915 user3103915 - 4 months ago 8
HTML Question

Avoid changing select tag after first change

Consider that I have the following select tag:

<select id="select_val">
<option>This is first</option>
<option>This is second</option>
</select>


Now what I want is , I want the select to be present however in disabled state as in we cannot change it further.
e.g if he selects option two i.e This is second, he cannot change it further. How can i do that using jquery. Thanks in advance

Answer
$('#select_val').change(function(){
    $(this).prop('disabled', true);
})
Comments