次の構成でループを実行する際に問題が発生しました。
<div id="items">
<p id="test1">
<select name="1" id="1"><option>A</option><option selected>B</option></select>
<input type="text" name="to" id="to">
<input type="text" name="away" id="awy">
</p>
<p id="test2">
<select name="2" id="2"><option>A</option><option selected>B</option></select>
<input type="text" name="to" id="to">
<input type="text" name="away" id="awy">
</p>
<p id="test3">
<select name="3" id="3"><option>A</option><option selected>B</option></select>
<input type="text" name="to" id="to">
<input type="text" name="away" id="awy">
</p>
</div>
test1、test2、test3を実行し、選択したオプションとテキストフィールドの値(select、to、away)を読み取る必要があります。たとえば、test1で1つしか取得できなかった場合にこれを行うと、クエリに問題はありません。
$('#items').children('p').each(function () {...}
しかし、2つのテキストフィールドを追加し、テストごとにこれを実行したい場合(1〜3)、わかりません...
何か案が?ありがとう!