Black Fire Asked:2020-06-25 21:37:09 +0000 UTC2020-06-25 21:37:09 +0000 UTC 2020-06-25 21:37:09 +0000 UTC 在离开锚链接的同时使用 jquery 删除 <a> 标记 772 您需要删除链接本身,留下描述它的文本。粗略地说,清除超链接的文本。它是如何实施的? javascript 2 个回答 Voted Stranger in the Q 2020-06-25T21:48:29Z2020-06-25T21:48:29Z 对不起,但没有骑师,如果有必要和他一起看答案@Qwertiy document.querySelectorAll('a').forEach(a => { a.parentNode.insertBefore(document.createTextNode(a.textContent), a); a.remove(); }) <a href="https://google.com">google.com</a> hello <a href="https://yandex.ru">yandex.ru</a> Best Answer Qwertiy 2020-06-25T22:14:04Z2020-06-25T22:14:04Z $("a").replaceWith(function () { return $(this).contents() })
对不起,但没有骑师,如果有必要和他一起看答案@Qwertiy