Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

click() vs dispatchEvent() on disabled elements

node v10.24.1
version: master
endpointsharetweet
const { JSDOM } = require("jsdom"); const { window } = new JSDOM(` <!DOCTYPE html> <html> <body><button disabled></button></body> </html> `); const button = window.document.querySelector('button'); button.addEventListener('click', () => console.log('click')); button.click(); button.dispatchEvent(new window.MouseEvent('click'))
Loading…

no comments

    sign in to comment