私は、リストを反復処理し、Beanを使用して値を表示しています:書き込み、私は私の行の詳細をキャプチャするONFOCUSイベントを使用してなど特定の行から値を取得することができません。<ロジック:反復>
コードの何かを使用していますこれは:
<logic:iterate id="empList" name="search" property="empList" indexId="index">
<tr>
<td>
<span id="empid"><bean:write name="empList" property="empID"/></span>
</td>
<td>
<bean:write name="empList" property="firstName"/>
</td>
<td>
<bean:write name="empList" property="lastName"/>
</td>
<td>
<html:button property="View" value="View" onfocus="viewPage()"/>
</td>
</tr>
</logic:iterate>
<script>
function viewPage(){
var empid = document.getElementByID("empid).innerHTML;
}
</script>
が、私はそれがD寿getElementId()
で、 変数は、あなたが間違った関数名を使用するようだ
[__Thereは、同じ 'id'の値を持つ' document'内の複数の 'elements'であってはなりません.___](https:// www .w3.org/TR/html-markup/global-attributes.html#common.attrs.id) – Rayon