You are here: Reference > JavaScript > client-side > HTML DOM > properties > borderColor (frame, frameset, table, ...)

borderColor property (frame, frameset, table, ...)

Browser support:
Sets or retrieves the color of the border.
To manipulate the border of the elements more efficiently, use the border style property.

Syntax:

object.borderColor;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: borderColor

Possible values:

A legal color value. It can be a hexadecimal, RGB or predefined color value. For more information, see the page for colors.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the borderColor attribute:
Code
topFrame.htm
mainFrame.htm
<frameset rows="110,*" cols="*" border="10px" bordercolor="red">
    <frame src="topFrame.htm" name="topFrame" scrolling="No"/>
    <frame src="mainFrame.htm" name="mainFrame"/>
</frameset>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to use borderColor attribute in a table:
<table border="4px" borderColorDark="green" borderColorLight="blue">
    <tbody>
        <tr>
            <td>cell 1</td>
            <td>cell 2</td>
        </tr>
        <tr>
            <td>cell 3</td>
            <td>cell 4</td>
        </tr>
    </tbody>
</table>
Did you find this example helpful? yes no

Example HTML code 3:

You can get the borderColor property of the frameset from one of its frames. The code below shows how to implement it.
<script type="text/javascript">
    function GetFramesetBorderColor () {
        var frameSet = window.frameElement.parentNode;
        return frameSet.borderColor;
    }
</script>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content