gpt4 book ai didi

Javascript Value 由几个词组成 [value=dog crazy]

转载 作者:行者123 更新时间:2023-11-30 08:56:19 26 4
gpt4 key购买 nike

感谢本论坛的帮助,我的代码能够正常工作:

// ==UserScript==
// @name PARINGO
// @description Auto select rpt radio button
// @namespace PARINGO
// @include https://docs.google.com/spreadsheet/viewform?formkey=dG1fdUU1bTR5R1l3dmtGS095QVYxZlE6MQ
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant GM_addStyle
// @version 1
// ==/UserScript==
/*- The @grant directive is needed to work around a design change introduced
in GM 1.0. It restores the sandbox.
*/
//-- Note that :contains() is case-sensitive
var questionLabel = $(
"label.ss-q-title:contains('How much is 1+1') ~ ul.ss-choices"
).first ().find ("input[type=radio][value=2]");
questionLabel.prop ('checked', true);

var questionLabel = $(
"label.ss-q-title:contains('How much is 4+2') ~ ul.ss-choices"
).first ().find ("input[type=radio][value=6]");
questionLabel.prop ('checked', true);

这个脚本的作用是检查标签并标记正确答案。但是如果响应由两个或多个单独的词组成。没有作品例如:

var questionLabel   = $(
"label.ss-q-title:contains('How much is 4+2') ~ ul.ss-choices"
).first ().find ("input[type=radio][value=dog crazy]");
questionLabel.prop ('checked', true);

这适用于谷歌文档中的表单: Form Google Docs

任何人都可以告诉我该值如何接受单独的单词?

("input[type=radio][value=dog crazy]")

最佳答案

如果一个属性由多个单词组成,那么您必须使用这样的引号:

"input[type=radio][value='dog crazy']"

关于Javascript Value 由几个词组成 [value=dog crazy],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13333094/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com