Advertisement
728x90
Initially iFrame needs to be accessed using either document.getElementBy or window.frames. After that contentWindow property of iFrame gives the access for targetFunction
javascript
1document.getElementById("targetFrame").contentWindow.targetFunction();
2
3window.frames[0].frameElement.contentWindow.targetFunction(); // Accessing iframe this way may not work in latest versions chrome and firefoxAdvertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 37
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
293of476