Click to See Complete Forum and Search --> : Changing frameborder with JavaScript


jovialjonny
07-10-2003, 03:09 PM
Hi,
I have two iframes on my webpage and I don't want any frameborders on either. The first is hard coded HTML like so:
<iframe id="frm1" frameborder="0" scrolling="Auto"></iframe>

The second is created dynamically when needed using document.createElement:
var ifrm = document.createElement("IFRAME");
ifrm.id = "frm"+reverseId;
ifrm.scrolling = "Auto";
ifrm.frameborder = "0";

This works fine for the hard-coded frame but the problem is the frameborder is still there on the iframe that is dynamically created. Am I making a syntax error or does anyone know why this won't work?

Jona
07-10-2003, 03:26 PM
ifrm.frameborder = 0;


Try it without the quotes.

[J]ona

jovialjonny
07-10-2003, 03:30 PM
Nope that had no effect

Jona
07-10-2003, 03:34 PM
Perhaps it's case-sensetive here. Try this:


ifrm.frameBorder = 0;


[J]ona

jovialjonny
07-10-2003, 03:36 PM
Thats it! Case sensitive...thanks, good aul programming where the case of one letter can make all the difference!:)