首页 文章

VBA改变ARIA-控制 Value

提问于
浏览
0

早上好,

我正在尝试使用VBA填写使用“Aria”的在线表单 . 该程序非常简单,适用于任何不使用Aria的表单,但是我很难将其调整到此站点 . HTML如下:

<div class="selectwrapper"> <label class="has-float-label shadow" for "event-0-line-0-name"> <div class="react-autosuggest__container" role="combobox" aria-expand ="false" aria-haspopup="listbox" aria-owns="react-autowhatever-event-0-line-0-name"> <input class="react-autosuggest__input" aria-controls="react-autowhatever-event-0-line-0-name" aria-autocomplete="list" type="text" placehold="" autocomplete="off" value = "" /> <div class="react-autosuggest__suggestions-container" id="react-autowhatever-event-0-line-0-name" role="listbox" value="VALUE FROM PROGRAM">

目前我正在使用 .getElementByID.setAttribute("value", "random text") . 在HTML中,这确实会改变ID的值,但是在表单上它仍然是空白的 . 我想我必须改变aria-controls下的值,但我不确定如何在VBA中这样做 . (当我手动更改Aria-Controls下的值时,它会在表单上更新 .

我猜测我只需要将_716923改为其他东西,但我不确定那是什么 . 任何帮助将不胜感激 . 谢谢!

1 回答

  • 0

    目前我正在使用.getElementByID和.setAttribute(“value”,“random text”) . 在HTML中,这确实会改变ID的值

    我不是在这里说的 . 设置“ value ”属性不会更改ID .

    我想我必须改变aria-controls下的值,但我不确定如何在VBA中执行此操作 .

    ARIA属性与任何其他属性一样,可以使用 setAttribute 进行更改 . 例如,要更改 aria-expanded 属性,请执行以下操作:

    setAttribute('aria-expanded', 'true');
    

    但是,更改ARIA属性不会影响您的表单 . ARIA属性是屏幕阅读器和其他辅助技术的提示,它们的值不会影响视觉显示 .

相关问题