You are here: Reference > JavaScript > client-side > HTML DOM > objects > nodes and tags > frame

frame object

Browser support:
Specifies a nameable window region.
The frame element allows authors to insert more than one HTML document into a browser window. It must be within a frameset element. Using frames can prevent search engines from finding the contents within pages, so it is not recommended to use the frameset and frame elements (because of the indexing mechanism of search robots).

Syntax:

Properties that reference the object:
window.frameElement
Methods that return the object:
document.createElement ("frame")
The base interface, through which you can add new functionalities to the frame object, is the HTMLFrameElement interface.
If you want to see the HTML objects by categories, please visit this page.
HTML page for this element: frame

Possible members:

Properties
Methods
Events
Style properties
allowTransparency
9
Sets or retrieves whether a frame element (frame or iframe) can be transparent.
attributes
Represents a collection of attribute nodes that belong to an element.
baseURI
10
Returns the base URL for the object.
behaviorUrns
Represents a collection of the Uniform Resource Names for all behaviors attached to an element.
borderColor
Sets or retrieves the color of the border.
canHaveChildren
Retrieves a Boolean value that indicates whether the element can contain child elements.
canHaveHTML
Retrieves a Boolean value that indicates whether the element can contain HTML formatted text.
className
Sets or retrieves the style class or classes that belong to the element.
clientHeight
Returns the height of the visible area for an object, in pixels. The value contains the height with the padding, but it does not include the scrollBar, border, and the margin.
clientLeft
Returns the width of the left border in pixels.
clientTop
Returns the height of the top border in pixels.
clientWidth
Returns the width of the visible area for an object, in pixels. The value contains the width with the padding, but does not include the scrollBar, border, and the margin.
contentDocument
8
Retrieves the document generated by a frame or iframe element.
contentEditable
3
Sets or retrieves whether the contents of the object are editable.
contentWindow
Retrieves the window generated by a frame or iframe element.
currentStyle
Represents the computed style settings for an element.
dataFld
Specifies or returns which field of a given data source should be bound to the specified object.
dataFormatAs
Specifies or returns how data is to be rendered.
dataSrc
Sets or retrieves the identifier of the data source that is bound to the element.
filters
Represents a collection of all filter objects applied to an element.
frameBorder
Sets or retrieves whether the frame is surrounded by a 3-D border.
height
Specifies or returns the height of an element.
id
Sets or retrieves a unique identifier for the object.
isContentEditable
Returns a Boolean value that indicates whether the contents of the object are editable by the user.
isDisabled
Returns a Boolean value that indicates whether the object is disabled.
isMultiLine
Returns a Boolean value that indicates whether the contents of an element can be multiline or not.
isTextEdit
Returns a Boolean value that indicates whether the createTextRange method can be used for the element.
language
Sets or retrieves the scripting language for the current element. Use it only for the script element.
localName
9
Returns the local part of the qualified name of the current node.
longDesc
Specifies or retrieves the URI (Uniform Resource Identifier) of the long description of a frame, iframe or img element.
marginHeight
Sets or retrieves the top and bottom margins for a frame element.
marginWidth
Sets or retrieves the left and right margins for a frame element.
name
Sets or retrieves the initial name of the contained window.
namespaceURI
93.6
Sets or returns the namespace URI of the current node.
nextElementSibling
93.5
Returns a reference to the next child element of the current element's parent.
nextSibling
Returns a reference to the next child of the current element's parent.
nodeName
Returns the name of the current node.
nodeType
Returns an integer that indicates the type of the node.
nodeValue
Sets or returns the value of the current node.
noResize
Specifies or returns whether a frame window is resizable.
offsetHeight
Returns the height of the visible area for an object, in pixels. The value contains the height with the padding, scrollBar, and the border, but does not include the margin.
offsetLeft
Returns the left position of an object relative to the left side of its offsetParent element, in pixels.
offsetParent
Returns a reference to the closest ancestor element in the DOM hierarchy from which the position of the current element is calculated.
offsetTop
Returns the top position of the object relative to the top side of its offsetParent element, in pixels.
offsetWidth
Returns the width of the visible area for an object, in pixels. The value contains the width with the padding, scrollBar, and the border, but does not include the margin.
outerHTML
Sets or retrieves the outer HTML content (the source code including the opening and closing tags) of an element.
outerText
Sets or returns the text content of an element including the text content of its descendants.
ownerDocument
Returns the document object that contains the current node.
parentElement
Returns the parent element of the object in the DOM hierarchy.
parentNode
Returns the parent element of the current node in the DOM hierarchy.
parentTextEdit
Returns the closest ancestor element of the current element in the DOM hierarchy that can be used to create a TextRange object.
previousElementSibling
93.5
Returns a reference to the previous child element of the current element's parent.
previousSibling
Returns a reference to the previous node of the current element's parent.
readyState
Returns a string value that represents the state of the object.
recordNumber
Returns an integer value that indicates the ordinal position of the item within the data set that generated the current object.
runtimeStyle
Represents the overridden style settings for an element.
scopeName
Retrieves the local name of the namespace declared for the current element.
scrolling
Sets or retrieves whether a frame has scrollbars.
sourceIndex
Returns the position of the current object in the all collection of the document.
src
Sets or retrieves the location of an associated file for an object.
style
Represents the inline style settings for an element or a CSS rule.
tabIndex
Specifies or returns the tabbing order for keyboard navigation using the TAB key.
tagName
Returns the tag name of the current element.
tagUrn
Sets or retrieves the Uniform Resource Name (URN) of the namespace declared for the current element.
title
Specifies or returns a tooltip for an element.
uniqueID
Returns the unique identifier generated by the browser for the object.
unselectable
Sets or retrieves whether the selection process can start in an element's content.
width
Specifies or returns the default width of the element.

Example HTML code 1:

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

Related pages:

External links:

User Contributed Comments

Post Content

Post Content