- Impact
- 1
i am trying to get all the headers (text in <h3> tags) in a webpage and i seem to be stuck on this, it all works fine until i try to put all the headers in one line
i would use some uber-cool javscript framework but GCSE ICT needs me to use javascript that has to be made by ME or else i have to go through each line and redocument millions of lines of code just to use one function
p.s. please note that i am not great at javascript
i would use some uber-cool javscript framework but GCSE ICT needs me to use javascript that has to be made by ME or else i have to go through each line and redocument millions of lines of code just to use one function
Code:
var n;
var temp;
var text = ["| "];
var titles=document.getElementsByTagName("h3");
for (n=0; n<titles.length; n++)
{
temp = titles[n].innertext;
text.push(titles[n].innertext);
text.push(" | ");
}
p.s. please note that i am not great at javascript















