如何找到具有特定值的所有输入元素,例如"ABC"?
document.querySelectorAll('input[value="ABC"]');
$('input[value="ABC"]'); // .length is 0
如何找到具有特定值的所有输入元素,例如"ABC"?
document.querySelectorAll('input[value="ABC"]');
$('input[value="ABC"]'); // .length is 0
If the inputs value was set by js or the user, you have to check the inputs' value property and I don't believe there is a way to do that with a css selector.
You'll have to use good ole js
var $abc = $('input').filter((i,v) => v.value === "ABC");