I'm not sure what hide behavior you want, but if the space should remain in the page you can toggle the visibility property.
You'd do this with event listeners rather than inline JavaScript. Also note that objects don't have a click event, so we'll put it on the wrapper and disable click events on the object. See How to bind click event to object tag?.
document.querySelector('.img-thumb').addEventListener('click', event => {
event.currentTarget.style.visibility = 'hidden';
document.querySelector('.obj-wrapper').style.visibility = 'visible';
});
document.querySelector('.obj-wrapper').addEventListener('click', event => {
event.currentTarget.style.visibility = 'hidden';
document.querySelector('.img-thumb').style.visibility = 'visible';
});
.img-thumb {
position: absolute;
opacity: ;
left: 0%;
top: 0%;
width: 100%;
height: 400px;
margin-left: 0px;
margin-top: 0px;
z-index: 100;
}
.obj-wrapper {
visibility: hidden;
}
.obj-wrapper object {
pointer-events: none;
}
<img src="https://i.ibb.co/ZBkxZHW/360-overlay-white.png" class="img-thumb" />
<div class="obj-wrapper">
<object scrolling="no" data="https://via.placeholder.com/400" width="100%" height="400" type="text/html">
</object>
</div>