title: Get value of a tag(<span>) for use in if/else conditional statement
body: <p>Here is a code:</p>
  
  <pre><code>&lt;span id="dpos"&gt;30&lt;/span&gt;
  
  &lt;script&gt;
  var pxwidth;
  
  $( "#id" )
  
  
  .bind( "keydown", function( event ) {
   pxwidth = $("#dpos").text();
  
   if (pxwidth === 0)
   {
   // do something
   }
  
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Here I am trying to get the value of the span element that is used in a conditional (if/else statement). But the statement does not execute. What is the correct usage of <code>if (pxwidth === ?)</code>?</p>