It also pastes the links on the same page, thing is, in my loop as you'll see below it pastes the link then I try to <br /> to display the next underneath like so (on the same page):
Basically it works perfect for link 1 but it doesnt loop back around and grab the 2nd link.
Ideally I would like numbered links with a total at the bottom, I've been sitting trying to do it for about 3 hours now
Heres my code, will explain much faster if you run it:
<TITLE> New Document </TITLE>
document.getElementById("htmlDiv").innerHTML = document.getElementById("htmlArea").value;
a = document.getElementById("htmlDiv").getElementsByTagName("a");
for(i=0; i < a.length; i++)
var divReport = document.getElementById("report");
report.innerHTML = (a[i].href);
<textarea id="htmlArea" cols=50 rows=20></textarea>
<button onclick="open_links();">Check Links</button>
<div style="font-family: Lucida Console; color: rgb(255, 255, 255); font-size: 12px; background: none repeat scroll 0% 0% black; width: 523px;" id="report">
<div id="htmlDiv" style="display: none;"></div>
If anyone has an idea why it wont run I'd be greatful, because what I can do is make it work fine but it makes a new page, I want it on the same page below the text area
Thanks in advance for any help!