如何检查文本是否是客户端的所有空格字符? [英] How to check if a text is all white space characters in client side?
本文介绍了如何检查文本是否是客户端的所有空格字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查用户输入的文本是否是客户端的所有空格字符(空格,制表符,输入等)?
How to check if a user input text is all white space characters (space, tab, enter etc) in client side?
提前致谢!
推荐答案
这个问题用jQuery标记。在jQuery中,您可以运行以下命令:
This question is tagged with jQuery. In jQuery, you can run the following:
if ( $.trim( $('#myInput').val() ) == '' )
alert('input is blank');
这篇关于如何检查文本是否是客户端的所有空格字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文