首页 > 解决方案 > Javascript 在 Google 表单上设置下拉值

问题描述

我创建用户脚本/插件来填写谷歌表单的输入,但我无法更改下拉列表的值。

演示页面和我尝试过的

document.querySelector('.quantumWizMenuPaperselectOption.exportOption').click()
document.querySelectorAll('.quantumWizMenuPaperselectContent.exportContent')[1].click()

标签: javascriptgoogle-forms

解决方案


解决了,所以有4个元素.quantumWizMenuPaperselectContent.exportContent所以我需要选择最后一个元素

document.querySelectorAll('.quantumWizMenuPaperselectContent.exportContent')[3].click()

或更改选择器

document.querySelectorAll('.exportSelectPopup div span')[1].click()

推荐阅读