IDの割り当てをせずにjQueryでこのような名前付き入力を適切に選択するにはどうすればよいですか?Javascriptの名前の配列の入力セレクタ(名前[sometext])
<input name="person[first]" type="hidden">
<input name="person[last]" type="hidden">
// Seems to be acting on multiple hidden elements instead of this named one
// This sets the value of both of those hidden elements in some cases
$("input[type=hidden][name=person[first]]").val('Test');
// So I've changed it to this. Is there a better way?
$("input[name=person[first]]").val('Test');
HTMLを含む複数の非表示の入力要素がある場合に、何がうまくいかないかの例を挙げることができますか?あなたの例からは明らかではありません。 – Anurag