excel - 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
解决方案
推荐阅读
- xpath - XPath 获取除 div 之外的所有内容,包括文本
- python - 使用 Outlook.OpenSharedItem 打开带有空格的文件会出错
- php - 在 Vtiger CRM 中选择生成采购订单时自动填写发票编号
- python - 在pytorch中的矩阵和向量之间加/减
- apache-kafka - Confluent 的 Kafka REST 代理与 Kafka 客户端
- python - RPi3 中的 cv2.VideoWriter 比实际更快
- laravel - Laravel 路由段
- javascript - ReferenceError:真正分配值时分配中的左侧无效
- python - 如何解决 Pybluez 操作系统错误
- docker - docker swarm relabel 实例中的 Prometheus dns 服务发现