How to make an artificial double click?
-
It is necessary to simulate a double click, preferably through the inline code "double click mouse test page" or through the browser code.JavaScript Anonymous, Jul 2, 2020
-
create and call a double click event
// создаем новое событие
var evt = new Event('dblclick');
// будем дабл-кликать по элементу с Id - "test"
var button = document.getElementById('test');
// здесь все и происходит!
button.dispatchEvent(evt);
real example:
Anonymous
1 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!