Changing value of an attribute using jQuery - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:attr

Description

Changing value of an attribute using 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  a  va2s .  c o m*/
$('#my').attr('name','photo[[1,2,4]]')
    });

      </script> 
   </head> 
   <body> 
      <input class="uploadReptCtrl" id="my" name="photo[[1,2,3]]" type="file">  
   </body>
</html>

Related Tutorials