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.
window.onload = function(){
var myImg = document.getElementById('myImg');
document.getElementById('hideBtn').onclick = function(){
myImg.style.display = 'none';
};
document.getElementById('showBtn').onclick = function(){
myImg.style.display = '';
};
document.getElementById('toggleBtn').onclick = function(){
var display = getComputedStyle(myImg).display=='none'?'':'none';
myImg.style.display = display;
};
}
