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?
Asked
Active
Viewed 3,011 times
3

Sar
- 33
- 1
- 4
-
You still use InternetExplorer 5? You've got my respect. – Reporter Oct 07 '16 at 14:53
-
Yes, if the client asks for IE5 ;) – Sar Oct 07 '16 at 15:10
2 Answers
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