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.
如何检查属性中字符串的长度?这显示“未定义”值:
var action = $(obj).closest("form").attr('action'); alert(action.lenght);
你的拼写有点不对劲,.lenght应该是.length:
.lenght
.length
var action = $(obj).closest("form").attr('action'); alert(action.length);
在您在某处发帖之前找不到某些方法时,请始终转到 api。
http://api.jquery.com
http://api.jquery.com/length/