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

  • @pranavs_productions
    @pranavs_productions3 жыл бұрын

    Learnt a new thing today ❤️

  • @ysnirob4125
    @ysnirob41253 жыл бұрын

    The exact thing I wanted Thank you Dom

  • @smoothbeak

    @smoothbeak

    3 жыл бұрын

    Me too!

  • @victory_lucky
    @victory_lucky3 жыл бұрын

    Thanks for this

  • @smoothbeak
    @smoothbeak3 жыл бұрын

    Very helpful

  • @thearmor9231
    @thearmor92312 жыл бұрын

    Cool video!

  • @rangabharath4253
    @rangabharath42533 жыл бұрын

    Awesome 👍

  • @amarjitnayak7574
    @amarjitnayak75743 жыл бұрын

    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.

  • @Hamzadlaras
    @HamzadlarasАй бұрын

    Nice job

  • @ilubuverimac2841
    @ilubuverimac28412 жыл бұрын

    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?

  • @DominusChaos74
    @DominusChaos742 жыл бұрын

    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

    @DominusChaos74

    2 жыл бұрын

    if figured out, I add a callafter function.

  • @juanchavarria7919

    @juanchavarria7919

    Жыл бұрын

    @@DominusChaos74 Hey would you mind to share how you did it? Thanks

  • @4541047
    @45410473 жыл бұрын

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

  • @younesbav0up316
    @younesbav0up3162 жыл бұрын

    thanks for the video, is this React or Javascript ?

  • @dcode-software

    @dcode-software

    2 жыл бұрын

    Hey, this is plain JavaScript

  • @younesbav0up316

    @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

  • @streamx2
    @streamx23 жыл бұрын

    I dont get what @param does

  • @fuadcs22

    @fuadcs22

    2 жыл бұрын

    It is a documentation for that class. It is shown in the code suggestion.

  • @DrDoSchoffy
    @DrDoSchoffy3 жыл бұрын

    any libraries that do this for me?

  • @ikechukwucharles2314

    @ikechukwucharles2314

    11 ай бұрын

    None I have seen on npm

  • @kshitizshah6685
    @kshitizshah66853 жыл бұрын

    Lovely , I am your biggest fan with small body

  • @jamarimcfarlane4844
    @jamarimcfarlane48442 жыл бұрын

    It works on the youtube like button too..

  • @lifestory1275
    @lifestory12752 жыл бұрын

    thx. nice

  • @dcode-software

    @dcode-software

    2 жыл бұрын

    No problem!