This element is obsolete and should no longer be used. Use CSS animation instead. Creates a scrolling text marquee.
HTML information
| Closing Tag | required |
|---|---|
| CSS Display | block |
DOM Information
Inheritance Hierarchy
Members
The marquee object has these types of members:
Methods
The marquee object has these methods.
| Method | Description |
|---|---|
| applyElement |
Makes the element either a child or parent of another element. |
| blur |
Causes the element to lose focus and fires the onblur event. |
| clearAttributes |
Removes all attributes and values from the object. |
| click |
Simulates a click by causing the onclick event to fire. |
| componentFromPoint |
Returns the component located at the specified coordinates via certain events. |
| contains |
Checks whether the given element is contained within the object. |
| doScroll |
Simulates a click on a scroll bar component. |
| dragDrop |
Initiates a drag event. |
| focus |
Causes the element to receive the focus and executes the code specified by the onfocus event. |
| getAttribute |
Retrieves the value of the specified attribute. |
| getBoundingClientRect |
Retrieves an object that specifies the bounds of a collection of TextRectangle objects. |
| getClientRects |
Retrieves a collection of rectangles that describes the layout of the contents of an object or range within the client. Each rectangle describes a single line. |
| getElementsByClassName |
Gets a collection of objects that are based on the value of the class attribute. |
| getElementsByTagName |
Retrieves a collection of objects based on the specified element name. |
| hasAttributes |
Determines whether one or more attributes exist for the object. |
| mergeAttributes |
Copies all read/write attributes to the specified element. |
| msMatchesSelector |
Determines whether an object matches the specified selector. |
| removeAttribute |
Removes an attribute from an object. |
| replaceAdjacentText |
Replaces the text adjacent to the element. |
| setActive |
Sets the object as active without setting focus to the object. |
| setAttribute |
Sets the value of the specified attribute. |
Properties
The marquee object has these properties.
| Property | Description |
|---|---|
|
Sets or retrieves the access key for the object. | |
|
Specifies whether the element and its contents must be selected as a whole, indivisible unit. | |
|
Retrieves a collection of attributes of the object. | |
|
Deprecated. Sets or retrieves the background color behind the object. | |
|
Gets a value indicating whether the object can contain child objects. | |
|
Retrieves the value indicating whether the object can contain rich HTML markup. | |
|
Sets or retrieves the class of the object. | |
|
Retrieves the height of the object including padding, but not including margin, border, or scroll bar. | |
|
Retrieves the distance between the offsetLeft property and the true left side of the client area. | |
|
Retrieves the distance between the offsetTop property and the true top of the client area. | |
|
Retrieves the width of the object including padding, but not including margin, border, or scroll bar. | |
|
Sets or retrieves the string that indicates whether the user can edit the content of the object. | |
|
Sets or retrieves a field of a given data source, as specified by the dataSrc property, to bind to the specified object. | |
|
Sets or retrieves the rendering format for the data supplied to the object. | |
|
Sets or retrieves the source of the data for data binding. | |
|
Sets or retrieves the reading order of the object. | |
|
Sets or gets the value that indicates whether the user can interact with the object. | |
|
Sets or gets the value that indicates whether the object visibly shows that it has focus. | |
|
Sets or retrieves the horizontal margin for the object. | |
|
Sets or retrieves the string identifying the object. | |
|
Sets or retrieves the HTML between the start and end tags of the object. | |
|
Sets or retrieves the text between the start and end tags of the object. | |
|
Gets the value that indicates whether the user can edit the contents of the object. | |
|
Gets the value that indicates whether the user can interact with the object. | |
|
Retrieves the value indicating whether the content of the object contains one or more lines. | |
|
Sets or retrieves the language to use. | |
|
Sets or retrieves the language in which the current script is written. Note This has been superceded by the type attribute for the script element. If you are using javascript alone, you don't need to specify a type or language with the script element. | |
|
Retrieves the height of the object relative to the layout or coordinate parent, as specified by the offsetParent property. | |
|
Retrieves the calculated left position of the object relative to the layout or coordinate parent, as specified by the offsetParent property. | |
|
Retrieves a reference to the container object that defines the offsetTop and offsetLeft properties of the object. | |
|
Retrieves the calculated top position of the object relative to the layout or coordinate parent, as specified by the offsetParent property. | |
|
Retrieves the width of the object relative to the layout or coordinate parent, as specified by the offsetParent property. | |
|
Sets or retrieves the object and its content in HTML. | |
|
Sets or retrieves the text of the object. | |
|
Retrieves the current state of the object. | |
|
Sets or retrieves the role for this element. | |
|
Retrieves the scrolling height of the object. | |
|
Sets or retrieves the distance between the left edge of the object and the leftmost portion of the content currently visible in the window. | |
|
Sets or retrieves the distance between the top of the object and the topmost portion of the content currently visible in the window. | |
|
Retrieves the ordinal position of the object, in source order, as the object appears in the document's all collection. | |
|
Sets an inline style for the element. | |
|
Sets or retrieves the index that defines the tab order for the object. | |
|
Retrieves the tag name of the object. | |
|
Sets or gets the URN specified in the namespace declaration. This property is not supported for Windows Store apps using JavaScript. | |
|
Sets or retrieves advisory information (a ToolTip) for the object. | |
|
Retrieves an autogenerated, unique identifier for the object. | |
|
Retrieves the element's unique number. | |
|
Sets or retrieves the vertical margin for the object. |
Standards information
There are no standards that apply here.
Remarks
The default width of the marquee element is equal to the width of its parent element. When a marquee is in a td that does not specify a width, you should explicitly set the width of marquee. If neither the marquee nor the td has a width specified, the marquee is collapsed to a 1-pixel width.
To create a vertically scrolling marquee, set its scrollLeft property to 0. To create a horizontally scrolling marquee, set its scrollTop property to 0, overriding any script setting.
The scrollLeft and scrollTop properties are read-only while the marquee is scrolling. When not scrolling, scrollLeft is read/write for a marquee set to scroll horizontally and scrollTop is read/write for a marquee set to scroll vertically.
Examples
The following example uses the marquee element to scroll the marquee from left to right across the screen, moving it 10 pixels every 200 milliseconds.
<marquee behavior="SCROLL" direction="RIGHT" scrollamount="10" scrolldelay="200"> This is a scrolling marquee. </marquee>
The following example shows some uses of the scrollLeft and scrollTop properties with the marquee element.
<marquee id="m1" direction="right" height="200" style="border-width: 2px; border-style: solid;" width="200">right</marquee><br>
<!-- Push this button to read the scrollLeft and scrollTop property values
as the marquee scrolls. -->
<button onclick="alert('scrollLeft: ' + m1.scrollLeft + ' scrollRight: ' + m1.scrollTop)">
Read</button>
<!--When the marquee is stopped, you can set scrollLeft in a horizontal marquee,
or set scrollTop in a vertical marquee. -->
<button onclick="m1.stop();m1.scrollLeft = 190;"> Stop & Set scrollLeft=190</button>
<button onclick="m1.start();">Start</button>
Build date: 11/28/2012