JavaScript Reference/Javascript Properties/clear — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 08:22, 26 мая 2010

"clear" Example

    
<html>
<head>
<script language="JavaScript">
    function function1() {
        document.getElementById("myB").clear = "all";
    }
    function function2() {
        document.getElementById("myB").clear = "left";
    }
    function function3() {
        document.getElementById("myB").clear = "right";
    }
    function function4() {
        document.getElementById("myB").clear = "none";
    }
</script>
</head>
<body>
<img src="yourimage.gif" 
     alt="This is a float=left image"
     width="99" 
     height="80" 
     style="float:left">
<br id="myB">
<p align="left">Here is the <br> element</p>
<input type="button" value="Clear all" onClick="function1();">
<input type="button" value="Clear left" onClick="function2();">
<input type="button" value="Clear right" onClick="function3();">
<input type="button" value="Clear none" onClick="function4();">
</body>
</html>



"clear" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<br>                                                          |
+----------------+--------------------------------------------------------------+



"clear" Possible Values

Possible Values
all           clears all sides, 
left          clears the left side, 
right         clears the right side,
none          all sides allow floating objects



"clear" Syntax and Note

Note:
Read and write property. 
How to position elements around <br>. 
    
Syntax:
    
document.getElementById("brID").clear = value
document.all.brID.clear = value // IE only