我有以下 HTMLTableRowElement。我需要根据输入和选择元素的名称字段和对应值将其转换为 json。是否有库或 jquery 方法可以做到这一点?当在行的 jquery 对象上调用时,jquery 的 serializeArray 方法返回一个空数组,例如 $('the following HTMLTableRowElement').serializeArray()。
<tr id="row7">
<td>
<input type="text" id="person_row7" name="person_row7">
</td>
<td>
<input type="text" id="father_row7" name="father_row7">
</td>
<td>
<input class="input-mini" type="text" id="age_row7" name="age_row7">
</td>
<td>
<select id="gender_row7" class="input-small" name="gender_row7">
<option value="" selected="selected">
---------
</option>
<option>
Male
</option>
<option>
Female
</option>
</select>
</td>
<td>
<input id="phonenumber_row7" name="phonenumber_row7" type="text">
</td>
</tr>