Clear Attribute required for options in jquery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:attr

Description

Clear Attribute required for options in jquery

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from   w w w .  j ava  2  s  . c  o  m
$('select').attr("required","");
    });

      </script> 
 </head> 
 <body> 
  <form> 
   <select> <option value=""></option> <option value="something">someting</option> </select> 
   <input type="submit"> 
  </form>  
 </body>
</html>

Related Tutorials