javascript - Cannot access a Iframe elements from other Iframe on a page -


i have problems iframes in chrome. have 3 iframes in page. trying access elements of 1 iframe another.

i using code:

navframe = window.parent.frames[0]; lnktags = navframe.document.getelementsbytagname('a'); 

i getting following error: cannot call method 'getelementsbytagname' of undefined

i read in forums window.parent not work in chrome. possible differently.

you need use contentwindow property so:

navframe = window.parent.frames[0]; lnktags = navframe.contentwindow.document.getelementsbytagname('a'); 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -