There is an iframe in my website. It shows an article. And I need to make a button to increase the font size of that HTML page. Button must be in the parent page. Is it possible ? And how ?
Asked
Active
Viewed 20 times
0
-
1If you control iframe page code you can. Otherwise no – charlietfl Jan 28 '18 at 16:44
1 Answers
0
Possible duplicate:
How can I access iframe elements with Javascript?
Also:
http://www.dyn-web.com/tutorials/iframes/refs/iframe.php
You can access the iframe
DOM element from JavaScript and check it for
ifrm.contentDocument
or
ifrm.contentWindow.document
properties.
// reference to iframe with id 'ifrm'
var ifrm = document.getElementById('ifrm');
// using reference to iframe (ifrm) obtained above
var win = ifrm.contentWindow; // reference to iframe's window
// reference to document in iframe
var doc = ifrm.contentDocument? ifrm.contentDocument: ifrm.contentWindow.document;
// reference to form named 'demoForm' in iframe
var form = doc.getElementById('demoForm');

bash.d
- 13,029
- 3
- 29
- 42