0

I have a simple function in the HTML inside of my iframe, also I use a button that executes the function onclick. What I would like to do is have the button on the parent page and work the same way.

    function saveEdits(){
        var editElem1 = document.getElementById("edit1");
        var userVersion1 = editElem1.innerHTML;
            localStorage.userEdits1 = userVersion1;

    <input type="button" value="Save Changes" onclick="saveEdits()"/></br>

What Would I do to put the button on the parent page and have it call the function in the iframe?

amazingacademy
  • 143
  • 1
  • 9
  • 1
    possible duplicate of [How to call javascript function specified in a child ](http://stackoverflow.com/questions/5946656/how-to-call-javascript-function-specified-in-a-child-frame) – artm Sep 24 '14 at 20:24
  • It is similar but not a duplicate, that just creates a frame that has a function inside of it that runs. Like an error message box. – amazingacademy Sep 24 '14 at 20:42

0 Answers0