CSS: Is a hidden object clickable?

后端 未结 4 617
醉梦人生
醉梦人生 2020-12-05 03:35

If the visibility property of the style of an HTML element is set to hidden, is it still clickable?

When the display property

4条回答
  •  伪装坚强ぢ
    2020-12-05 04:37

    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

提交回复
热议问题