如何<a>
在页面中找到包含 href attr 的任何元素/dailyTickets/front/user.form.php
,然后将其更改为/dailyTickets/front/contacts.form.php
?
请注意,我希望将 URL 查询参数 (id) 保留在路径 (user.form.php) 之后。例如,改变这个:
<a id="User_648_648" href="/dailyTickets/front/user.form.php?id=648">ConseillerUser</a>
对此:
<a id="User_648_648"href="/dailyTickets/front/contacts.form.php?id=648">ConseillerUser</a>
我从这个开始,但我不知道如何结束它:
$('a[href*="dailyTickets/front/user.form.php"]').each(function () {
if ($(this).children().length == 0) {
...........
}
});