このようなpricesというname属性のvalueを取得したいです。
html
1<input name="prices[1][1]" type="text" class="form-control" form="update" value="10000"> 2<input name="prices[2][1]" type="text" class="form-control" form="update" value="20000"> 3<input name="prices[1][2]" type="text" class="form-control" form="update" value="30000"> 4<input name="prices[2][2]" type="text" class="form-control" form="update" value="40000">
以下のように書けば取れると思ったのですが”[]”と返ってきます。
javascript
1var values = $("input[name='prices']").map(function () { 2 return $(this).val(); 3}).get();
どうやって書けばいいのかわからずどなたか教えて頂いてもいいでしょうか?
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/24 03:32
2017/07/24 03:34