1
我創建了一系列複選框,我想知道是否可以從中獲取值和id元素。舉例來說,如果我有一個HTML表單以下複選框:我可以從複選框中獲取「id」和「value」元素嗎?
<html>
<body>
<form action="formInput.php" method="post">
<table border="1" width="100%">
<thead><p style="font-family:Arial" style="font-size:15px">This is my Form.</p></thead>
<tr>
<td width="33%" ><input type="hidden" id="item_1" name="interventions[]" value="false" />
<input type="checkbox" id="item_1" name="interventions[]" value="true" /> Item 1</td>
<td width="33%"><input type="hidden" id="item_2" name="interventions[]" value="false" />
<input type="checkbox" id="item_2" name="interventions[]" value="true" /> Item 2</td>
<td width="33%"><input type="hidden" id="item_3" name="interventions[]" value="false" />
<input type="checkbox" id="item_3" name="interventions[]" value="true" /> Item 3</td>
</tr>
</table>
</body>
<html>
,纔有可能有一個對id元素或foreach循環?
由於提前,
-Kenny