有人可以在下面的 jQuery 上帮助我吗?
我想根据第 1 场和第 2 场信息自动添加玩家的总得分、SR 等。
HTML
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Name</th>
<th>Total Runs</th>
<th>Total Balls</th>
<th>Match 1 Runs</th>
<th>Match 1 Balls</th>
<th>Match 2 Runs</th>
<th>Match 2 Balls</th>
<th>Strite Rate</th>
</tr>
<tr>
<td>Player 1</td>
<td>Total Runs: <span class="player-stat-runs"></span></td>
<td>Total Balls: <span class="player-stat-balls"></span></td>
<td>15</td>
<td>16</td>
<td>20</td>
<td>14</td>
<td><span class="player-stat-avg"></span></td>
</tr>
<tr>
<td>Player 2</td>
<td>Total Runs: <span class="player-stat-runs"></span></td>
<td>Total Balls: <span class="player-stat-balls"></span></td>
<td>3</td>
<td>4</td>
<td>68</td>
<td>94</td>
<td><span class="player-stat-avg"></span></td>
</tr>
</table>
CSS
table,th,td{border:1px solid #222;border-collapse:collapse;max-width:500px;}th{font-weight:bold;background:#efefef;}th,td{padding:5px;}
- 球员总跑数(第 1 场比赛 + 第 2 场比赛)
- 球员打出的总球数(第 1 场球+ 第 2 场球)
- 击球手击球率(PS:如果击球手从 10 个球中得分 10 次,SR = 100.00)