[英]“getElementsByClassName” in IHTMLDocument3
In my BHO (COM DLL), I have code to get the elements by 'id' and 'name' using IHTMLDocument3's getElementById
and getElementsByName
api's. 在我的BHO(COM DLL)中,我具有使用IHTMLDocument3的
getElementById
和getElementsByName
api通过“ id”和“ name”获取元素的代码。 I need to get the elements by class name
. 我需要通过
class name
获取元素。 But I dint find any getElementsByClassName
api with IHTMLDocument3. 但是我没有找到任何带有IHTMLDocument3的
getElementsByClassName
api。 I need to get the elements by 'class'. 我需要按“类”获取元素。
How can I get the collection elements of 'class' using IHTMLDocument3? 如何使用IHTMLDocument3获取“类”的集合元素?
How can I get the collection elements of 'class' using IHTMLDocument3?
如何使用IHTMLDocument3获取“类”的集合元素?
Manually iterating over the DOM and examining element properties. 手动遍历DOM并检查元素属性。
However there is a getElementsByClassName
as part of IHTMLDocument7
, but this requires a later version of IE to be installed (IE * if I recall correctly). 但是有一个
getElementsByClassName
作为一部分IHTMLDocument7
,但这需要IE的后续版本进行安装(IE *如果我没有记错)。 If you have a sufficient version of IE, then you can QueryInterface
for IHTMLDocument7
given an interface pointer to an earlier version. 如果您具有足够的IE版本,则可以为
IHTMLDocument7
QueryInterface
提供给早期版本的接口指针。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.