How to Detect Click and Hold Events - JavaScript Tutorial

preview_player
Показать описание
In today's video I'll take you through how to detect click (or press) and hold
events in JavaScript. This is pretty straightforward to do using a class.

💜 Join my Discord Server:

Support me on Patreon:

Follow me on Twitter:
@dcodeyt

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript
Рекомендации по теме
Комментарии
Автор

The exact thing I wanted
Thank you Dom

ysnirob
Автор

Great tutorial!!! Thanks.
How can we undone something after release the held button?
If instead of an alert, we change the div background color. After release, how can we remove this change?

DominusChaos
Автор

I made button that can be clicked and "click and hold", every time I release the click and hold, it triggers the click event too. Is there a way to avoid this?

ilubuverimac
Автор

Nice Video Sir. I am beginner to JS. I have a requirement to block Windows 10 default context menu open on press and hold in my for my App which runs on Microsoft Surface touch screen. Whether the same code should work for the same, I mean press and hold - What extra thing do I have to do ? Waiting for your quick response. tank you.

amarjitnayak
Автор

thanks for the video, is this React or Javascript ?

younesbavup
Автор

Lovely, I am your biggest fan with small body

kshitizshah
Автор

Great toturial!
Can you please share the code with us?
Thank U :)

Автор

It works on the youtube like button too..

jamarimcfarlane
visit shbcf.ru