0

I try to change this jquery

$('.myOwnClass').removeClass('myOwnClass').unbind('dblclick');

for use in vanillajs / typescript. I can remove the class with the following code. But the unbind I do not know so far

const myList = document.querySelector('.myOwnClass') as HTMLElement;
    myList.classList.remove('myOwnClass');

1 Answers1

0

Try to use .removeEventListener()

didn't use a lot of jQuery but from my understanding it's almost the same but using the Dom's events mechanism

eifr
  • 21
  • 5
  • Thank you. But what is the second parameter ov removeEventListener? In jQuery I use no additional information to remove the dblclick –  Aug 13 '21 at 15:31
  • 1
    You need to add the event handler (the one you used in `.bind`). If you're don't have it, you can always `coneNode` https://stackoverflow.com/a/19470348 – eifr Aug 14 '21 at 16:15