How to Detect Click and Hold Events - JavaScript Tutorial
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:
/ discord
Support me on Patreon:
/ dcode
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
Пікірлер: 25
Learnt a new thing today ❤️
The exact thing I wanted Thank you Dom
@smoothbeak
3 жыл бұрын
Me too!
Thanks for this
Very helpful
Cool video!
Awesome 👍
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.
Nice job
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?
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?
@DominusChaos74
2 жыл бұрын
if figured out, I add a callafter function.
@juanchavarria7919
Жыл бұрын
@@DominusChaos74 Hey would you mind to share how you did it? Thanks
Great toturial! Can you please share the code with us? Thank U :)
thanks for the video, is this React or Javascript ?
@dcode-software
2 жыл бұрын
Hey, this is plain JavaScript
@younesbav0up316
2 жыл бұрын
@@dcode-software thank you so much, i was searching on how i can target clicked button in a shoping card of three element and then increment that specific button. thanks again
I dont get what @param does
@fuadcs22
2 жыл бұрын
It is a documentation for that class. It is shown in the code suggestion.
any libraries that do this for me?
@ikechukwucharles2314
11 ай бұрын
None I have seen on npm
Lovely , I am your biggest fan with small body
It works on the youtube like button too..
thx. nice
@dcode-software
2 жыл бұрын
No problem!