Why does != work and just = doesn't?
<p>Here's my code:</p>

<pre><code>  if (document.getElementById("hiddenButton").style.visibility != "visible") {
     document.getElementById("hiddenButton").style.visibility = "visible";
  }
  else {
     document.getElementById("hiddenButton").style.visibility = "hidden";

  }
</code></pre>

<p>This code shows and hide a HTML button when you click on another button.</p>

<p>But my question is why does that code work and this doesn't:</p>

<pre><code>  if (document.getElementById("hiddenButton").style.visibility = "hidden") {
     document.getElementById("hiddenButton").style.visibility = "visible";
  }
  else {
     document.getElementById("hiddenButton").style.visibility = "hidden";

  }
</code></pre>
