You have to write your own fnc, it does not come embed in the DOM object. I basically translate an old JavaScript fnc written years ago for admin-management via the web. The DOM provide the same functionality regarless of the language queryring it (js, vbs, etc).
I include a 'GetParentTagName' fnc to skip the search from the body document (faster). Refer to 'GetElementsByClass' fnc for the core script. You can ajust for having a more generic i.e. search any attribute name, not just a class attribute.
Here is the code (HTML ex + VBS for HTA) :
HTML code
=========
<table name="product_not_approve">
<tbody name="cieA" >
<tr class="tr_205F51AF-4245-4258-96A3-76DC13B978BB">
<td fieldname="checkbox_delete">
<input type="checkbox" name="delete_opt_cieA" value="205F51AF-4245-4258-96A3-76DC13B978BB" />
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<a href="#" onclick="Admin_Accept_Save_Change me">Make change</a>
</td>
</tr>
</tfoot>
</table>
VBS code
' =================================================================
Sub Admin_Accept_Save_Change(this)
'msgbox this = window.event.srcElement
'msgbox this.outerHTML
Dim oEleParent : Set oEleParent = GetParentTagName(this, "table")
'msgbox oEleParent.tagName & " - " & oEleParent.outerHTML
' Fnc GetElementsByClass((searchClass, node, tag)) return a dictionary object, node can be null, search from DOM body
Dim oEles : Set oEles = GetElementsByClass("tr_" & "205F51AF-4245-4258-96A3-76DC13B978BB", oEleParent, "tr")
Dim oEle
For i = 0 To oEles.Count - 1
'msgbox oEles.Keys()(i) & ", " & TypeName(oEles.Items()(i))
Set oEle = oEles.Items()(i)
msgbox oEle.outerHTML
Next
' Cancel href event
window.event.returnValue = False
End Sub
' =================================================================
Function GetParentTagName(oEle, tagName)
Dim oParent : Set oParent = oEle.parentNode ' oEle.parentElement.outerHTML
Do While UCase(oParent.tagName) <> UCase(tagName)
Set oParent = oParent.parentNode
If UCase(oParent.tagName) = "BODY" Then
Set oParent = Nothing
Exit Do
End If
Loop
Set GetParentTagName = oParent
End Function
' =================================================================
Function GetElementsByClass(searchClass, node, tag)
If IsNull(node) Then Set node = document
If IsNull(tag) Or tag = "" Then tag = "*"
Dim oElements : Set oElements = node.getElementsByTagName(tag)
Dim oDic : Set oDic = CreateObject("Scripting.Dictionary")
oDic.CompareMode = vbTextCompare
' msgbox "typename node = " & TypeName(node) & vbCrLf & _
' "tag = " & tag & vbCrLf & _
' "searchClass = " & searchClass & vbCrLf & _
' "nb of ele found = " & oElements.length
Dim i : i = 0
Dim oEle, oAtt
Do While i < oElements.length
Set oEle = oElements(i)
Set oAtt = oEle.Attributes.getNamedItem("class") ' Return a DispHTMLDOMAttribute object
If oAtt.value = searchClass Then
'msgbox "Found class : " & oAtt.name & " - " & oAtt.value
oDic.Add oDic.count + 1, oEle
End If
i = i + 1
Loop
'msgbox "Nb of DOM element found : " & oDic.Count
Set GetElementsByClass = oDic
End Function