1 out of 5 rated this helpful - Rate this topic

frameborder attribute | frameBorder property

[This documentation is preliminary and is subject to change.]

Sets or retrieves whether to display a border for the frame.

Syntax

HTML<element frameborder="p" ... >
JavaScript

p = object.frameBorder

Property values

Type: String

1

Default. Inset border is drawn.

0

No border is drawn.

no

No border is drawn.

yes

Inset border is drawn.

Remarks

Invalid settings default to displaying borders.

 

 

Build date: 3/8/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
frameborder is not in modern and future standards but can IE avoid its usage?
frameborder is not defined in XHTML1 Strict and seems that it won't be in HTML5.
IE8 can't render a no-border iframe with CSS only and without frameborder.
So IE8 is not fully XHTML1 Strict capable. Does it fixed in IE9?
Dynamic iframes
On dynamically created iframes, this property should be set before the iframe is attached to the document, otherwise it won't work
Standard Information
As yes/no is not defined in the W3C spec, I DO recommend to add such info (be aware that yes/no is not the standard or so) in the standard information section.
A work-around for the above.
Do iframe.outerHTML = iframe.outerHTML. It re-renders and the border is gone. Lame, but it works. In my case I was doing this before the iframe contained any content, so it wasn't too big a deal. This probably is not a viable solution if your iframe contains a lot of content.
Unreliable

This property not always works on dynamically created iframes. If you set this property to 0, “0” or “no” before the document is loaded, it works just as explained on the text above. However it seems like once the document is loaded you cannot do anything to get rid of the 3d border. If you use the debugger to trace the script you will notice the property is actually changed, but the change is not reflected on the screen.