I met a case when I use mshtml to detect the event when click on a htmlelement like a href, I use the code below:
DOMEventHandler onclickhandler = new DOMEventHandler(doc,null);
onclickhandler.NewEventHandlers += new DOMEvent(DOMEventMethods._click);
doc.onclick = onclickhandler;
void _click(IHTMLEventObj obj)
{
MessageBox.Show(obj.srcElement.tagName);
}
But if the htmlelement has a JavaScript onclick={dosomething();return false;}
then I cannot capture the event.
How do I fix the issue like this? Or is there any work around?