Waqas Tahir
Waqas Tahir

Reputation: 8262

How to get documentElement of an Iframe

When I run this code it does't work

goruncode(){
    editor = ace.edit('editor');
    var editorvaluet=editor.getValue();
    frames['screen'].document.documentElement.innerHTML = editorvaluet;" 
}

and in html

I have a <iframe id="screen"></iframe>

so when i click the update it does't update

Upvotes: 0

Views: 854

Answers (1)

a user
a user

Reputation: 24149

use

document.getElementById("screen").contentDocument.documentElement.innerHTML

Upvotes: 2

Related Questions