title: How do you add the CSS 'left' property in a JavaScript conditional statement?
body: <p>I'm trying to including a css "left" property to my javascript code such that if the left property in the css file matches the one in the javascript code, a certain action takes place. Any help will be appreciated.
  The HTML code is:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  
  &lt;button id = "myBtn"&gt;MyButton&lt;button&gt;
  
  &lt;p id= "demo"&gt;&lt;/p&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The CSS code is:</p>
  
  <pre><code>#myBtn {
     position: absolute;
     left: 100px;
  }
  </code></pre>
  
  <p>The script code is:</p>
  
  <pre><code>&lt;script&gt;
  if (document.getElementById("myBtn").style.left == "100px") {
     actionX //this is just an example
     }
  document.getElementById("demo").innerHTML = actionX;
  &lt;/script&gt;
  </code></pre>