Javascript examples for jQuery Selector:first
Enable only first option in a Select Box
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.5.2.js"></script> <script type="text/javascript"> $(window).load(function(){// ww w . ja va 2s .co m $('option').attr('disabled','disabled').eq(0).removeAttr('disabled'); }); </script> </head> <body> <select> <option>test</option> <option>test</option> <option>test</option> <option>test</option> </select> </body> </html>