Passing detail:clickCount to MouseEvent is necessary but not sufficient for triple-click to select all text. The select-all-on-triple-click is a browser native behavior that synthetic MouseEvent dispatch doesn't trigger. Add manual selection after click dispatch: when clickCount >= 3 and the target is an INPUT or TEXTAREA, set selectionStart=0 and selectionEnd=value.length.