我有一個包含元素類似於下面查找DOM的模式和替換它的內容使用jQuery
<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
更換和追加一個div?源= ABC在同一鏈路。
那麼,怎樣才能通過我每次行程下的div包含ID =「點擊」標籤,更換錨href的值?
人人都獻出了正確的答案,但因爲你即使給我一個解決方案,追加**?源= ABC **所以,接受你的解決方案的答案 – abi1964
乾杯,祝你好運與您的項目 – Asciiom
只是硬編碼的'?源= abc'一部分會失敗,其中源URL已經擁有了'?'或''#零件。如果您需要,我添加了功能。 –