title: "if" statement parameters not functioning as intended. JavaScript
body: <p>The following JavaScript <em>"if"</em> statement is not reading the parameters as I intended both parameters to be read. When I shoot <em>bulletOne</em> with a function that uses an interval to run <strong>bulletOneLeft++;</strong> the left CSS property of <em>bulletOne</em> increases by 1 with each interval as intended. However, when I coded the following <em>if</em> statement to detect the CSS style.left property of the <em>bulletOne</em> and compare it to the CSS style.left property of an element called "<strong>targetBox</strong>"; the code does not recognize the difference of the CSS style.left properties of these two elements. My question is how can I make this <em>if</em> statement execute once bulletOne's CSS style.left property is greater than targetBox's CSS style.left property numerically?</p>
  
  <pre><code>if (bulletOneLeft &gt; targetLeftProp){
  document.getElementById("targetBox").style.opacity = "0";   
  };
  </code></pre>
  
  <p>The two parameters of <strong><em>bulletOneLeft</em></strong> and <strong><em>targetLeftProp</em></strong> are described with the following code;</p>
  
  <p><strong><em>bulletOneLeft;</em></strong></p>
  
  <pre><code>#bulletOne {
  position: absolute;
  background-color: white;
  height: 1px;
  width: 6px;
  top: 0px;
  left: 0px;
  }
  bulletOne.style.left = bulletOneLeft;
  </code></pre>
  
  <p><strong><em>targetLeftProp;</em></strong></p>
  
  <pre><code>#targetBox{
  position: absolute;
  background-color: green;
  height: 20px;
  width: 20px;
  top: 30px;
  left: 310px;
  opacity: 1;
  }
  var targetLeftProp = window.getComputedStyle(CSSelement, 
  null).getPropertyValue("left");
  </code></pre>
  
  <p><strong><em>PREVIOUS FAILED ATTEMPT;</em></strong>
  I have tried many different combinations of code, the following was my first failed attempt. The following code seemed the most logical at the time;</p>
  
  <pre><code>var bulletLeft = document.getElementById("bulletOne").style.left;
  var targetLeft = document.getElementById("targetBox").style.left;
  
  if (bulletOneLeft &gt; targetLeft){
     document.getElementById("targetBox").style.opacity = "0";   
  };
  </code></pre>