Changing the font of a "iframe"

I’m making a Rich Text Editor, like this one here, and I have a problem.

I’m using an IFRAME, and the default font is Times New Roman. I want to change it to Verdana on the page load, but I have no idea how.

I tried this:

function document.body.onload() {"Verdana";

But it doesn’t work. The ID of my IFRAME is “idContent” :slight_smile:

Uhm… your onload function won’t work as far as I can tell. And besides, the way you reference the iFrame element in your JavaScript also wont work as you are referring to its name, not its ID.

Try this instead:

<script language="JavaScript">
onload = function()
{ = "Verdana";
<iframe name="nameOfIFrame" src="iframe.htm" width="400" height="300"></iframe>

Note the changed onload, and that the iFrame element doesn’t have an ID but a name (which I changed to “nameOfIFrame” just to make it more obvious :slight_smile: ).

Hope that helps,

Hey all…
I am a bit confused on this… I am trying to change the font color of an iframe… but am uncertain where to put the commands?

Anybody know?

Thanks in advance,

<script language=“javascript”>
var urlstr =;
function loadIframe(){
document.getElementById(“testframe”).src= “” + urlstr;

<body onLoad=“loadIframe()”>
<iframe id=“testframe” width=“600” height=“300”></iframe>
<script language=“javascript”>

if the page in the Iframe does not belong to same root, forget about it …
in other words if does not belong to you and page with script is not at something, it is not possible for crossbrowser security reasons

Thanks! XYZ is actually hosted on another domain… guess Ill have to live with it the way it is. Thanks again…