admin管理员组文章数量:1391943
How to remove the anchor tag text and href link using javascript
Or Jquery
<a id="ancID" href="Javascript:void(0)">Here insert a dynamic text </a>
I want to remove the text inserted between anchor tag..
How to remove the anchor tag text and href link using javascript
Or Jquery
<a id="ancID" href="Javascript:void(0)">Here insert a dynamic text </a>
I want to remove the text inserted between anchor tag..
Share Improve this question asked Dec 17, 2013 at 6:39 bgsbgs 3,2237 gold badges42 silver badges59 bronze badges 1- using javascript regex can anyone help? – yaswanthkoneri Commented Nov 26, 2019 at 13:23
2 Answers
Reset to default 4You can use .text('')
to remove text by assigning empty string. First use id selector to get the anchor tag.
Live Demo
$('#ancID').text('');
If you go the vanilla way:
var x = document.getElementById("ancID");
x.innerHTML = "";
x.href = "";
本文标签: jqueryHow to remove anchor tag text using JavascriptStack Overflow
版权声明:本文标题:jquery - How to remove anchor tag text using Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744662492a2618329.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论