Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery选择其中属性=值_Jquery_Jquery Selectors - Fatal编程技术网

jQuery选择其中属性=值

jQuery选择其中属性=值,jquery,jquery-selectors,Jquery,Jquery Selectors,我试图选择一个值等于动态值的输入 trimmed = jQuery.trim(a); preSelectedCheckBox = $(this).find("input[value=" + trimmed + "]"); 元素存在,但我始终没有返回任何值。($(preSelectedCheckBox).length=0)您是否只是缺少包含的单引号 trimmed = jQuery.trim(a); preSelectedCheckBox = $(this).find("input[value

我试图选择一个值等于动态值的输入

trimmed = jQuery.trim(a);
preSelectedCheckBox = $(this).find("input[value=" + trimmed + "]"); 

元素存在,但我始终没有返回任何值。($(preSelectedCheckBox).length=0)

您是否只是缺少包含的单引号

trimmed = jQuery.trim(a);
preSelectedCheckBox = $(this).find("input[value='" + trimmed + "']");
忽略值周围的“”

preSelectedCheckBox = $(this).find("input[value=" + trimmed + "]");