I'm trying to select this element which has square brackets in the name attribute:(我试图选择在name属性中具有方括号的此元素:)
<input type="text" name="inputName[]" value="someValue">
I've tried this (which doesn't work):(我已经尝试过了(这不起作用):)
$('input[inputName[]=someValue]')
and neither does this:(而且也不是:)
$('input[inputName[]=someValue]')
or this:(或这个:)
$('input["inputName[]"=someValue]')
EDIT: As some of you have pointed out, $('input[inputName=someValue]')
would never work.(编辑:正如你们中有些人指出的那样, $('input[inputName=someValue]')
将永远无法工作。)
What I was trying to do was: $('input[name=inputName][value=someValue]')
.(我想做的是: $('input[name=inputName][value=someValue]')
。) (But with []
in the name attribute).((但在name属性中使用[]
)。)
ask by aidan translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…