我正在尝试在页面上选择多个类并将其更改aria-checked="false"
为aria-checked="true"
. 这是我现在使用的脚本:
elms=document.getElementsByClassName("d-va-p a-f-e");
for (i=0;i<elms.length;i++){
if(elms[i].getAttribute("aria-checked")="false")
elms[i].getAttribute("aria-checked")="true"
};
源代码如下。课程是“d-va-p afe”。
<div class="d-va-p a-f-e" style="-webkit-user-select: none;" role="option" tabindex="-1" aria-checked="false" id=":89">
<div class="a-f-e" style="-webkit-user-select: none;">
<div class="d-va-p-Fe a-f-e" style="-webkit-user-select: none;">
<img src="https://lh4.googleusercontent.com/-FxDBvNDkbj4/AAAAAAAAAAI/AAAAAAAAAAA/q4f7Fc7OF6A/s48-c/photo.jpg" class="d-va-p-Z a-f-e">
</div>
<div class="a-f-e d-va-p-yda" style="-webkit-user-select: none;">
<div class="d-va-p-Ec a-f-e" style="-webkit-user-select: none;">Herb Smith</div>
</div>
</div>
<div class="d-va-p-iI-oc" style="-webkit-user-select: none;">
<span class="a-f-e d-J-Eb-v-YA-Me" style="-webkit-user-select: none;"></span>
</div>
</div>