我有一个包含如下元素的 div
<input type="hidden" name="subscribe_message" value="Success"/>
<div class="titleBlue">Alerts</div>
<table cellpadding="2" cellspacing="0" width="100%"><tr><td align="LEFT" height="35">
<tr>
<td><a style="cursor:hand;text-decoration:underline" target="_blank" href="https://abc.global.com/kb/solution/21/Pages/136776.aspx">ab1</a></td>
</tr>
<tr>
<td><a style="cursor:hand;text-decoration:underline" target="_blank" href="https://abc.global.com/kb/solution/21/Pages/136775.aspx">ab2</a></td>
</tr>
<tr>
<td><a style="cursor:hand;text-decoration:underline" target="_blank" href="https://abc.global.com/kb/solution/21/Pages/136774.aspx">ab3</a></td>
</tr>
<tr>
<tr>
<td><a href='#' onClick="javascript:window.open('https://my-prod.global.com/gmm2/kb/dlink.do?externalId=<a style="cursor:hand;text-decoration:underline" target="_blank" href="https://abc.global.com/kb/solution/20/Pages/157468.aspx">157468 </a></td>
</tr>
<tr>
<td><a style="cursor:hand;text-decoration:underline" target="_blank" href="https://abc.global.com/kb/solution/20/Pages/147468.aspx">147468 </a></td>
</tr>
</table>
我需要一种方法来查找锚标记中的所有内容,并在同一链接中abc.global.com
替换cab.global.com
并附加?source=abc 。
那么如何遍历包含 id="clicker" 的 div 下的每个 a 标签并替换锚点 href 值呢?