JavaScript Reference/Javascript Properties/noWrap

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

"noWrap" Example

    
<html>
<body>
<script language="JavaScript">
    function function1() {
        document.getElementById("myL").noWrap = true;
    }
    function function2() {
        document.getElementById("myL").noWrap = false;
    }
</script>
<div id="myL" style="position:absolute; width=50px;">
Attribute nowrap is not present in this div element"s tag.
</div>
<br>
<br>
<input type="button" value="Add noWrap = true" onclick="function1();">
<input type="button" value="Restore noWrap = false" onclick="function2();">
</body>
</html>



"noWrap" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<body>                          <dd>                          |
|                |<div>                           <dt>                          |
|                |<td>                            <th>                          |
+----------------+--------------------------------------------------------------+



"noWrap" Possible Values

Possible Values
true 
false              (the default).



"noWrap" Syntax and Note

Note:
Read and write property. 
Word wrap the content?
For <td>, the width property overrides noWrap. 
For <th>, the noWrap property overrides width.
    
Syntax:
    
document.body.noWrap = value
document.getElementById("elementID").noWrap = value
document.all.elementID.noWrap = value // IE only