Accessing elements form the document of an iframe using Element.getElementsBySelector(frameDoc,cssSelector) doesn't work as expected in IE 7 and Opera 9, while it does work on Firefox 2 and Safari (Windows).
On IE 7, it fails fetching elements with id selectors, as in "#elemID" or "#elemID chidlElem", and always returns an empty string, while if using className or tagName selectors such as ".myClass" and "div" it works fine.
On Opera 9, it dies with unhandled exception [Object DOMException] "WRONG_DOCUMENT_ERR".
var frame = (frames['testframe']) ? frames['testframe'].document : $('testframe').contentDocument;
// test that the element exists and is accessible by the browser
alert('getElementsByTagname(div): '+frame.getElementsByTagName('div'));
// fetch by id
alert('selector #testDiv: '+Element.getElementsBySelector(frame,'#testDiv'));
// fetch by tagname
alert('selector div: '+Element.getElementsBySelector(frame,'div'));
This is so on Prototype 1.5.1 and 1.6.0_rc0