jQuery()函数的4种调用方法 $(“CSS选择器”,context)$(Element or Document or Window);//将对象封装为jQuery()对象$(HTML字符串,{css:{},click:Function ,src:url});$(Function); <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>this is test</title> <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script> </head> <body> <div>1</div> <div>2</div> <div>3</div> </body> </html> <script> var divCol_1=$("div",document); var divCol_2 = $("document"); var $div = $("<div></div>",{css:{width:"100px",height:"100px",backgroundColor:"yellow"}}); document.body.appendChild($div[0]); $(function(){console.log("one");}); $(function(){console.log("two")}); </script>