www.webdeveloper.com
Results 1 to 2 of 2

Thread: clicking a link with a for loop doesn't work

  1. #1
    Join Date
    Dec 2012
    Posts
    6

    clicking a link with a for loop doesn't work

    Hello in the code below i am trying to download all the xml that exist on the page simply by runing the code.
    but with this code , only one is being downloaded , i guess its the last one.
    What should i do ?
    Thanks for your help.

    Code:
    var fruit=document.getElementsByClassName('tbody')[2].getElementsByTagName('tr');
    var j=0
    var s=[]
    var k=[]
    for(var i=0;i<fruit.length;i++){
    s=fruit[i].getElementsByTagName('td')[2].innerText;
    if(s.substr(s.length-3,22)=="xml"){
    k[j]=s.replace(/\s+/g, '');
    document.getElementById(k[j]+"_cell").click();
    j++
    }
    };

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,255
    Show pertinent HTML code so we don't have to start/guess from scratch.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles