JavaScript Reference/Javascript Properties/left

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

"left" Example

    
<html>
<body>
<p id="myP" style="background-color:black; color:white; width:200;">
This is some sample text.
</p>
<button onclick="alert(myP.getBoundingClientRect().left);">Left</button>
</body>
</html>



"left" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |TextRectangle                                                 |
+----------------+--------------------------------------------------------------+



"left" Syntax and Note

Note:
Read and write property. 
Specifies the element left coordinate.
    
Syntax:
    
textRectangleName.left = value