使用jQuery隐藏文字中的字符? [英] Hide a character in text with jQuery?

查看:100
本文介绍了使用jQuery隐藏文字中的字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一些显示为名称:"的文本更改为名称".换句话说,我只想隐藏':'.

I want to change some text which says 'Name:' to 'Name'. In other words, I just want to hide the ':'.

jQuery是否可以在div中选择字符或单词?如果是这样,很容易隐藏':'字符,或者如果需要将文本替换为没有该字符的同一个单词.

Can jQuery select a character or word within a div? If so it would be easy to hide the ':' character or if needs be replace the text to same word but without that character.

谢谢

推荐答案

如果您想使用JQuery,

If you want to use JQuery then ,

$('#idOfTheTextDIV').html($('#idOfTheTextDIV').html().replace("texttoHide",""));

这篇关于使用jQuery隐藏文字中的字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆