因此,我需要基於計數來創建重複的錶行,我會通過網頁。例如,如果計數是3,我需要在表格標題下面3行。 Javascript更好。根據計數重複錶行並分配唯一標識
td標籤裏面有輸入標籤,供用戶進行更改然後最終提交,所以如果可能的話我想爲每個輸入標籤創建一個unigue id。以下是我的。
<div id="container">
<form id='associates'>
<table border="1"><tr>
<th>Assoc Name</th>
<th>Role</th>
<th>Agile Team</th>
<th>Agile Team 2</th>
<th>Agile Team 3</th>
<th>Agile Team 4</th>
<th>Agile Team 5</th></tr>
<tr>
<td ><input id='name' readonly value='Jordan Davis'></td>
<td ><input id='role' readonly value='Business Analyst'></td>
<td > <select id ='team1'>
<option value="1">Option 1 of row 1</option>
<option value="2">Option 2 of row 1</option>
<option value="3">Option 3 of row 1</option>
</select></td>
<td ><select id='team2'>
<option value="1">Option 1 of row 1</option>
<option value="2">Option 2 of row 1</option>
<option value="3">Option 3 of row 1</option>
</select> </td>
<td ><select id='team3'>
<option value="1">Option 1 of row 1</option>
<option value="2">Option 2 of row 1</option>
<option value="3">Option 3 of row 1</option>
</select> </td>
<td ><select id='team4'>
<option value="1">Option 1 of row 1</option>
<option value="2">Option 2 of row 1</option>
<option value="3">Option 3 of row 1</option>
</select> </td>
<td ><select id='team5'>
<option value="1">Option 1 of row 1</option>
<option value="2">Option 2 of row 1</option>
<option value="3">Option 3 of row 1</option>
</select> </td>
</form></div>
這個問題被標記爲'javascript',但不包含JavaScript?也許它在複製粘貼過程中丟失了? – Alex
我目前沒有任何javascript,我想添加javascript來幫助解決我的問題 –