CSS: Is a hidden object clickable?
With display: none
it is still part of the DOM. It just isn't rendered in the viewport.
As for clicks on elements with visibility: hidden
, the events are not fired.
jsFiddle.
$('div').click(function() {
alert('Hello')
});
div {
width: 100%;
height: 100%;
visibility: hidden;
}
<div>abc</div>
Making div hidden or display none just makes it un clickable to user. But in real its still an element in dom and you can click it with another java script/jquery like this.
$('div').click(function() {
alert('Hello')
});
$('div').click();
jsfiddle