如何将所有html元素替换为文本框中的空白并检查主角的长度? [英] How to replace all html element to blank from textbox and check the length of main character ?
本文介绍了如何将所有html元素替换为文本框中的空白并检查主角的长度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用ckeditor,
现在我的要求就像文本框一样应该atlest包含2个字符,
但是当ckeditor出现在图片中时,当我检查这个文本框的文本属性时,它也给了我一些html元素,比如, ,
等..现在我想忽略所有这些元素,只想检查实际内容长度
解决方案
< blockquote>我认为你可以使用 Regex
。请阅读此处 - 删除HTML标记 [ ^ ]。
Hi ,
I am using ckeditor ,
and now my requirment is like the textbox should atlest contains 2 character ,
but as ckeditor comes in the picture , when i check text property of this textbox , it gives me some html elements as well , like , ,
etc .. now i want to ignore all this elements and just want to check the actual contents length
解决方案
I think you can use Regex
for this. Read here - Remove HTML tags[^].
这篇关于如何将所有html元素替换为文本框中的空白并检查主角的长度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文