I am new to the javascript. I want to double click a button and write something to the console but the code I use doen’t work.
The code here: btn.addEventListener("dblclick",function);
This code didn’t work at the Microsoft Edge. I looked the documentation. At the documentation there are two way.
First way is (this way is same with my way):
addEventListener("dblclick", (event) => {});
Second way is:
ondblclick = (event) => {};
I tried two way but it didn’t work. And than I changed ‘dblclick’ to ‘ondblclick’ but it didn’t work again. But at this times I didn’t take any error or warning. At the last time I tried at the Google Chrome it worked successfully.
Why the same code worked at the Chrome but didn’t work at the Edge? What can I do to solve this problem?