jQuery-替换href =“&"的内容和 '#' [英] jQuery - Replace contents of href="" with '#'
本文介绍了jQuery-替换href =“&"的内容和 '#'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一种使用jQuery替换<a href="this text"
中包含的文本的方法,我想替换'#'
引号中包含的文本.
I need a way of replacing the text contained within <a href="this text"
using jQuery, I want to replace what ever text is held within quotes to a '#'
.
有什么建议吗?
推荐答案
$('a').attr('href', '#');
这篇关于jQuery-替换href =“&"的内容和 '#'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文