Getting value of input box that have user defined index in jquery - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Getting value of input box that have user defined index 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-1.10.1.js"></script> 
      <script type="text/javascript">
    $(window).load(function(){//  ww w .j a v  a  2  s.  c  o  m
result = $("#start\\[2\\]").val();
console.log(result);
    });

      </script> 
   </head> 
   <body> 
      <input id="start[2]" type="input" value="10" name="start[2]">  
   </body>
</html>

Related Tutorials