Show/Hide element when clicking buttons

后端 未结 2 1622
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-17 08:02

I have two buttons Show and Hide and I have an image so I want to know when I click the hide button the img will disappear and when I click show button it will appear again.

2条回答
  •  花落未央
    2021-01-17 08:42

    function show(){
      document.getElementById('image').style.display = "inline";
      }
    
    function hide(){
      document.getElementById('image').style.display = "none";
      }

提交回复
热议问题