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/