PDA

View Full Version : Getting tags from an iframe


christrinder
08-18-2006, 03:17 PM
Hi all,

I have a page with an iframe on it and from the parent page, i want to be able to get all the <a> tags to form an array. This following code doesn't work but hopefully gives you an idea of what I'm trying to achieve. Any ideas?

var aryInputs = document.getElementById("iframe1").all.tags("a");

alert(aryInputs.length);

Thanks in advance for your help.

Chris

mrhoo
08-18-2006, 04:58 PM
var who= document.getElementById("iframe1").contentWindow.document;
var A= who.getElementsByTagName('a')

christrinder
08-18-2006, 10:23 PM
Thanks I'll try this in a moment. Thanks so much for your help!