You are here: Reference > JavaScript > client-side > HTML DOM > properties > clear (address, br, Hn, pre, ...)
clear property (address, br, Hn, pre, ...)
| A A | Font size |
|
|
Share |
|
Specifies or returns the position of the element in relation to floating objects.
This property is deprecated. Use the clear style property instead.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
| HTML page for this property: clear |
Possible values:
String that sets or retrieves the position in relation to floating objects.
One of the following values:
| The element will be placed below any floating objects. | ||||||
| The element be placed below any floating objects on the left side. | ||||||
| Allows floating content on all sides. | ||||||
| The element will be placed below any floating objects on the right side. |
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the clear attribute:
|
|
||||
<img src="picture.gif" align="right" /> <h3 clear="right">This text should be placed below the image.</h3> <br/><br/><br/> <img src="picture.gif" align="right" /> <h3 clear="left">This text should be placed on the left side of the image.</h3> |
||||
|
||||
|
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the clear property:
|
|
||||
<head> <script> function ChangeBehavior (elem) { var br = document.getElementById ("clearTest"); // Returns the index of the selected option var whichSelected = elem.selectedIndex; // Returns the text of the selected option var scrollType = elem.options[whichSelected].text; br.clear = scrollType; } </script> </head> <body> <img src="picture.gif" align="left" /> <h3 id="clearTest" clear="all">Element with clear attribute.</h3> <br /><br /> Change the value of the clear attribute <div align="center"> <select onClick="ChangeBehavior (this);" size="4"> <option selected="selected" />all <option />left <option />right <option />none </select> </div> </body> |
||||
|
||||
|
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments

