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

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -