Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.51 KB | None | 0 0
  1. <table cellspacing="5" border="1">
  2.     <colgroup>
  3.         <col width="auto"></col>
  4.         <col width="12"></col>
  5.         <col width="auto"></col>
  6.         <colgroup>
  7.             <tbody>
  8.                 <tr>
  9.                     <td colspan=2> Wie viele Einheiten sollen in die neue Armee gebracht werden?</td>
  10.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var trList = this.closest('tbody').getElementsByTagName('tr'); for (let i=0; i<trList.length; i++){var tr = trList[i]; var count = tr.childNodes[1].childNodes[0].textContent.split(' ')[0]; tr.childNodes[3].childNodes[1].value = count;};">Alle</a> </td>
  11.                 </tr>
  12.                 <tr>
  13.                     <td id="1" align="right">495 Ritter</td>
  14.                     <td id="2">
  15.                         <input id="3" type="text" name="u0" size="12">
  16.                     </td>
  17.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var count = this.closest('tr').childNodes[1].childNodes[0].textContent.split(' ')[0];this.closest('tr').childNodes[3].childNodes[1].value = count;">Alle</a> </td>
  18.                 </tr>
  19.                 <tr>
  20.                     <td align="right">176 Heiler</td>
  21.                     <td>
  22.                         <input type="text" name="u1" size="12">
  23.                     </td>
  24.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var count = this.closest('tr').childNodes[1].childNodes[0].textContent.split(' ')[0];this.closest('tr').childNodes[3].childNodes[1].value = count;">Alle</a> </td>
  25.                 </tr>
  26.                 <tr>
  27.                     <td align="right">5 Generäle</td>
  28.                     <td>
  29.                         <input type="text" name="u2" size="12">
  30.                     </td>
  31.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var count = this.closest('tr').childNodes[1].childNodes[0].textContent.split(' ')[0];this.closest('tr').childNodes[3].childNodes[1].value = count;">Alle</a> </td>
  32.                 </tr>
  33.                 <tr>
  34.                     <td align="right">1196 Heiltränke</td>
  35.                     <td>
  36.                         <input type="text" name="u19" size="12">
  37.                     </td>
  38.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var count = this.closest('tr').childNodes[1].childNodes[0].textContent.split(' ')[0];this.closest('tr').childNodes[3].childNodes[1].value = count;">Alle</a> </td>
  39.                 </tr>
  40.                 <tr>
  41.                     <td align="right">311 Stahlschwerter</td>
  42.                     <td>
  43.                         <input type="text" name="u21" size="12">
  44.                     </td>
  45.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var count = this.closest('tr').childNodes[1].childNodes[0].textContent.split(' ')[0];this.closest('tr').childNodes[3].childNodes[1].value = count;">Alle</a> </td>
  46.                 </tr>
  47.                 <tr>
  48.                     <td align="right">246 Rüstungen</td>
  49.                     <td>
  50.                         <input type="text" name="u22" size="12">
  51.                     </td>
  52.                     <td style="text-align: center;"><a href="javascript:void(0)" onclick="var count = this.closest('tr').childNodes[1].childNodes[0].textContent.split(' ')[0];this.closest('tr').childNodes[3].childNodes[1].value = count;">Alle</a> </td>
  53.                 </tr>
  54.             </tbody>
  55. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement