public static void DoMouseClick(this HtmlElement elt, MouseButtons button = MouseButtons.Main) { var evt = new MouseEvent(elt.OwnerDocument, "click", new MouseEventInitOptions { Button = (short)button }); evt.InitEvent("click", true, true); elt.DispatchEvent(evt); }