Why does != work and just = doesn't?

后端 未结 6 400
陌清茗
陌清茗 2021-01-29 15:41

Here\'s my code:

  if (document.getElementById(\"hiddenButton\").style.visibility != \"visible\") {
     document.getElementById(\"hiddenButton\").style.visibili         


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 16:26

    It's because simple "=" is not for comparaison. Use "==" instead.

提交回复
热议问题