首页 > 解决方案 > getElementBy(Value?) 需要检查元素是否被点击打开(true) 或关闭(false)

问题描述

如何检查下一行是否为真。它是打开或关闭过滤器列表的元素的代码。如果过滤器关闭value=false,如果过滤器打开value=true

元素的 HTML 代码:

<div id="docTypeForm:filterPnl" class="rf-cp rf-tgp" style="margin-bottom: 10px;">
     <input id="docTypeForm:filterPnl-value" name="docTypeForm:filterPnl-value" 
     type="hidden" value="true">

该值将显示为真或假。当我第一次运行宏时它会起作用,因为下拉菜单默认为 false,但第二次下拉菜单为 true,所以我的代码此时失败。

我检查以下代码:

    If obJIE.document.getElementById("docTypeForm:filterPnl-Value").Hidden = False Then
        MsgBox False
    Else
        MsgBox True '

    End If
 If obJIE.document.getElementById("docTypeForm:filterPnl-Value").Value= False Then
If obJIE.document.queryselector("input("True")") = False then
 If obJIE.document.getElementById("docTypeForm:filterPnl-Value").getAttribute("Value")= False Then

标签: excelvba

解决方案


推荐阅读