Is it possible to add an eventlistener on a DIV?

后端 未结 3 438
Happy的楠姐
Happy的楠姐 2021-01-31 15:56

I know this function:

document.addEventListener(\'touchstart\', function(event) {
    alert(event.touches.length);
}, false);

But is it possibl

3条回答
  •  逝去的感伤
    2021-01-31 16:04

    The other way round if you are not using addEventListener, probably a alternative to get control over ID.

     $(document).ready(function () {
                $('#container1').on("contextmenu", function (e) {
                    e.preventDefault();
                });
            });
    

提交回复
热议问题