gpt4 book ai didi

jQuery - 按值查找单选按钮

转载 作者:行者123 更新时间:2023-12-01 01:02:30 24 4
gpt4 key购买 nike

我正在为这个问题摸不着头脑。

HTML:

<form>
<input name="changes" type="radio" value="2012-05-18T16%3A53%3A00.000000000000%2B0100">
<span>2012-05-18 16:53:00 +0100</span>
<input name="changes" type="radio" value="2012-05-29T16%3A51%3A00.000000000000%2B0100">
<span>2012-05-29 16:51:00 +0100</span>
<input name="changes" type="radio" value="2012-05-31T17%3A30%3A00.000000000000%2B0100">
<span>2012-05-31 17:30:00 +0100</span>
<input name="changes" type="radio" value="2012-06-01T16%3A30%3A00.000000000000%2B0100">
<input id="view-change" type="button" value="View">
</form>

在 Chrome JavaScript 控制台中:

var today = "2012-05-18T16%3A53%3A00.000000000000%2B0100"
$('input[value="2012-05-18T16%3A53%3A00.000000000000%2B0100"]') -> Finds object
$('input[value=today]') -> Nothing

嗯?为什么我无法使用 var 选择输入?

PS。我已经确认, jQuery.type(today) = string

最佳答案

尝试:

$('input[value="'+today+'"]')

参见jsfiddle

关于jQuery - 按值查找单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12175052/

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