Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 jquery 中创建自定义函数?
我想在文本输入上使用它,以检查用户是否真的输入了一些文本,或者只是空格。
您可以使用 .trim() 函数。
if ($.trim($("input-selector").val())) { //do Something }