Javascript examples for jQuery Method and Property:attr
Changing value of an attribute using jQuery
<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>