Javascript examples for CSS Style Property:position
Getting the element position - { absolute|relative|fixed }
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div {/*from w w w.jav a 2 s.c om*/ position: fixed; } </style> <script type="text/javascript"> window.onload=( function() { var div = document.getElementById("div"); console.log(div.style.position); console.log(getComputedStyle(div).position); }); </script> </head> <body> <div id="div" style="position: absolute;"></div> </body> </html>