javascript - Cant loop on selector jquery -


i'm trying loop on $("#"+i) doesn't work. keeps giving error. correct way loop on $() selector jquery

error:

uncaught typeerror: cannot read property 'innertext' of undefined(anonymous function) @ vm3311:29(anonymous function) @ total-mins.js?v=15:1 (anonymous function) @ vm3311:29 (anonymous function) @ total-mins.js?v=15:1

code:

    // ==userscript== // @name         test // @namespace    http://your.homepage/ // @version      0.1 // @description  enter useful // @author       // @match        https://mail.google.com/mail/u/0/#inbox // @grant        none // @include http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js // ==/userscript==       var list2 = []; settimeout(function () { test(); }, 4100);  function test() { $( document ).ready(function() {      for(var j = 0; j < 15; j++){         alert(j.tostring());         var list1 = [];     (var = 0; < 5; i++){          var x = $("#"+j).find('ul').find('li').find('span');          var content = x[i].innertext || x[i].textcontent;          list1[i] = content;     }     list2 += list1;     }     document.write(list2); }); } 


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -