string comparison fails in Javascript
<p>I'm using Alert() just to make sure I have a match between 'Login' and the innerHTML of an element on the page.</p>

<pre><code>var statusElement = document.getElementById('logged-in-status');
var currentLoggedInStatus = statusElement.innerHTML;

    alert("innerHTML is: " + currentLoggedInStatus);
</code></pre>

<p>When the alert box pops up, it says:  <strong>innerHTML is: Login</strong></p>

<pre><code>    var stringComp = (currentLoggedInStatus == "Login");
    alert("stringComp is: " + stringComp);
</code></pre>

<p>When this 2nd alert box pops up, it says:  <strong>stringComp is:  false</strong></p>

<p>So the code inside this 'if' statement ERRONEOUSLY executes.  I don't see how
the first alert() clearly says the innerHTML is 'Login' and yet the code inside the
'if' statement goes right ahead and executes.  I tried single-quotes around 'Login'
and it did not help.</p>

<pre><code>    if(currentLoggedInStatus != "Login")
    {
       navBarLoginStatusTextElement.innerHTML = 'Login';
    }
</code></pre>

<p>To reiterate, the innerHTML = Login and when I compare innerHTML to Login
it says they're not the same!  </p>

<p>Why is my javascript comparison above failing?  </p>

<p>EDIT:  here is the block element and the php function that sets the value of 'Login':</p>

<pre><code>&lt;a id="logged-in-status" 
       href="http://localhost/myProj/justAfile.php"&gt;&lt;?php echo getLoginStatusStr();?&gt; &lt;/a&gt;
</code></pre>

<p>and in a php block is the function:</p>

<pre><code> function getLoginStatusStr()
 {
      return 'Login';
 }
</code></pre>
