代码:
Private Sub Document_MouseDown(ByVal sender As Object, ByVal e As HtmlElementEventArgs)
Dim P As Point = web.PointToClient(MousePosition)
Dim he As HtmlElement = web.Document.GetElementFromPoint(P)
End Sub
Private Sub web_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles web.DocumentCompleted
AddHandler web.Document.MouseDown, New HtmlElementEventHandler(AddressOf Document_MouseDown)
End Sub
示例:<div id="id1" name="name1" style="width:100px">test<span>text</span></div>
he.id:标签ID,“id1”
he.name:标签name,“name1”
he.innerhtml:标签内容,“test<span>text</span>”
he.innerText:标签文本内容,“texttext”
he.style:标签style中的内容,“width:100px”
he.tagname:标签tagname,“div”