Usually, to hide a control or a block in HTML, we can use the following JavaScript to set the style of the control or the block,

document.getElementById(“”).style.display=”none”;

or apply the following  css,  

.some-css-name

{

   display:none

But it will remove the space occupied by the control as well. If we want to keep the space, but only want to hide the control, we can use the following way,

document.getElementById(“”).style.visibility=”hidden”;

or

.some-css-name

{

   visibility:hidden;

}

BTW, the reverse function of the above is as below,

document.getElementById("").style.display="inline"

document.getElementById("").style.visibility="visible";

相关文章:

  • 2021-08-03
  • 2021-11-24
  • 2021-10-02
  • 2021-11-28
  • 2022-02-25
  • 2021-07-01
  • 2022-12-23
  • 2021-08-05
猜你喜欢
  • 2022-01-06
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2021-08-18
相关资源
相似解决方案