Jquery官網上兩個each用法:javascript
http://api.jquery.com/jQuery.each/html
http://api.jquery.com/each/java
使用時注意點jquery
<!DOCTYPE html> <html> <head> <title>Untitled Page</title> <script type="text/javascript" src="jquery141.js"></script> <script type="text/javascript"> $(document).ready(function () { $(null).each(function(i,n){不會報錯 alert(n.id); }); //$.each(null,function(i,n){會報錯 // alert(n.id); //}); }); </script> </head> <body> </body> </html>