Jquery SPLIT field names - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:jQuery Method Example


Jquery SPLIT field names

Demo Code

ResultView the demo in separate window

  <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 ww  w. ja  va  2  s .c o  m*/
var arrayWithNames = [];
$('input').each(function () { arrayWithNames.push($(this).prop("name"));});

  <input name="recipe"> 
  <input name="recipe[]"> 
  <input name="recipe[0][asdf]"> 
  <input name="recipe[1][asdf]">  
  <input name="recipe[2][asdf]">  

Related Tutorials