javascript - Access to iframe parent elements -


i try apeend link div content iframe in page main window.

what did:

var mainwindow = window.parent; var link = document.createelement("a"); var node = document.createtextnode("http://localhost/" + 'dfgdgd'); link.setattribute('href', 'dfdsfdsf'); link.appendchild(node); success =  mainwindow.document.getelementbyid("suc_msg"); success.appendchild(link); 

but it's doesn't work, try alert success var , result is:

[object htmldivelement]

but not append link html? why that?


Comments