Code

Code

Invoking JavaScript code in an iframe from the parent page

document.getElementById('targetFrame').contentWindow.targetFunction();
Reference: http://stackoverflow.com/questions/251420/invoking-javascript-code-in-an-iframe-from-the-parent-page