3

I am trying to get an element by its className inside an iframe. as I use IE5 "getElementsByClassName" is not working. To get any element inside my document I used pega with the following: pega.util.Dom.getElementsByClassName("BlaBlaName"); However, this is not working for me when the element is inside an Iframe. I only gets elementById from the iframe using IframeinnerDoc.getElementById("IdBlala") How can I get the elements by tag name inside the iframe using Pega in IE5?

Sar
  • 33
  • 1
  • 4

2 Answers2

1

You can use:

pega.util.Dom.getElementsByClassName("BlaBlaName", "*", IframeinnerDoc);
Gyum Fox
  • 3,287
  • 2
  • 41
  • 71
0

you can try using contentWindow: http://www.w3schools.com/jsref/prop_frame_contentwindow.asp

something like this might work:

var x = document.getElementById("myframe");
var y = (x.contentWindow || x.contentDocument);
if (y.document)y = y.document;
y.getElementsByClassName('foo')
StackOverMySoul
  • 1,957
  • 1
  • 13
  • 21