How can I get an element from within a frameset frame using JavaScript?
You need to get the Document object for the frame. window.frames[1].document.getElementById(‘someElementId’)
You need to get the Document object for the frame. window.frames[1].document.getElementById(‘someElementId’)
Although they solved a problem at the time they were created (updating part of a “page” while keeping in place a non-updating part), framesets were criticised in terms of usability pretty much from the start, as they break generic functions of the browser, such as: bookmarking, and copy-and-pasting URLs to share printing the page as … Read more
document.getElementById(‘myframe1’).contentWindow.document.getElementById(‘x’) Fiddle contentWindow is supported by all browsers including the older versions of IE. Note that if the iframe‘s src is from another domain, you won’t be able to access its content due to the Same Origin Policy.