-1

im trying to change the font in iframe , but uts not working , now i have used 2 different functions but none of them worked ...

first i have used the following script below to make sure this is the iframe i want to change its font :

var X1 = document.getElementById("if1").contentWindow.frames[1].location.href;
alert (X1);

then i wrote theses 2 functions and none of then did the job :

method 1 :

function changeSize() {
    var frame = document.getElementById("if1");
    var content = (frame.contentDocument || frame.contentWindow);
    content.body.style.fontSize = "200%";
}

method 2 :

function changeSize() {

       var r =  document.getElementById("if1").contentWindow.frames[1].querySelector('body');



          r.style.fontSize = '200%';
}

both didnt work with me , any help where am i doing wrong ?

Darshit Patel
  • 700
  • 1
  • 6
  • 16
  • Possible duplicate of [How can I access iframe elements with Javascript?](http://stackoverflow.com/questions/1452871/how-can-i-access-iframe-elements-with-javascript) – Nikolas Feb 07 '17 at 10:58

1 Answers1

0

Take a look at that thread, they access their iFrame via javascript and describe how to edit the ref. Should get you going.

Community
  • 1
  • 1
Nikolas
  • 2,066
  • 1
  • 19
  • 20