更新时间:2023-11-23 15:30:04
您可以拆分字符串,然后计算结果数组的长度。
You would split the string and then count the length of the resulting array.
$('input[type="submit"]').click( function() { var words = $('#name').val().split(' '); alert(words.length); });
如何通过单元测试检查属性标记是否在ORM模型中计算?
如何在不使用 Try/Catch 的情况下检查字符串是否为 JavaScript 中的有效 JSON 字符串
如何使用javascript检查/取消选中单选按钮
如何使用Java检查句子中是否存在单词?
当我使用csharp单击组合框时,如何在datagridview中添加列
在 Python 中使用 Selenium,如何单击列表中每个项目的不同链接?
如何计算单词中的字母?
在Rails中,如何在使用javascript_include_tag之前检查javascript文件是否存在
如何检测Flash Player是否在使用JavaScript的浏览器中被禁用?
如何使用javascript检查是否在网页中加载了Font Awesome?