Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you clear the content programmatically? #62

Open
aclogarta opened this issue Apr 22, 2016 · 0 comments
Open

How do you clear the content programmatically? #62

aclogarta opened this issue Apr 22, 2016 · 0 comments

Comments

@aclogarta
Copy link

Hi There!

How can I clear the content programatically. I tried the following but it doesn't work:

    //Clear the inner html document of the iframe
    var iframe = document.getElementsByTagName("iframe")
    frameDoc = iframe[0].contentDocument || iframe[0].contentWindow.document;
    frameDoc.documentElement.innerHTML = '<head></head><body contenteditable="true"></body>';

Many thanks!
Antonio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant