Javascript examples for CSS Style Property:left
Get the left position of a <div> element:
<!DOCTYPE html> <html> <body> <div id="myDiv" style="position:absolute;left:255px;">This is a div element.</div> <button type="button" onclick="myFunction()">Return left position of div</button> <script> function myFunction() {// www . j ava 2s .c o m console.log(document.getElementById("myDiv").style.left); } </script> </body> </html>