Disable an input element by name - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Disable an input element by name

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-1.7.1.js"></script> 
      <script type="text/javascript">
    $(function(){/*from  w ww  .  j a va  2 s .  co m*/
$("input[name='val1']").prop("disabled", true);
    });

      </script> 
   </head> 
   <body> 
      <input type="file" name="val1">  
   </body>
</html>

Related Tutorials