Allow detail
argument for HTMLElement.click()
#7095
Labels
addition/proposal
New features or enhancements
interop
Implementations are not interoperable with each other
needs implementer interest
Moving the issue forward requires implementers to express interest
It would be useful if
HTMLElement.click()
accepted an optionalNumber
argument that became the value of the synthetic event'sdetail
property (representing the click-count).Currently, one can do something like
EventTarget.dispatchEvent(new MouseEvent('click', { detail: 1 }))
to achieve more-or-less the same thing, but:HTMLElement.click()
has no effect when the target is a disabled button, but when I tried usingEventTarget.dispatchEvent()
to fire a click-event on a disabled button, I found that behavior differed across browsers—e.g., in Safari the event-handler was executed, and in Chrome it was not.The text was updated successfully, but these errors were encountered: