jQuery-jQuery核心方法:jQuery()
jQuery()方法
jQuery()方法是jQuery的核心方法,通过这一方法来将Dom元素转换为jQuery对象,然后再对jQuery对象进行操作,实现对Dom元素的操作。
一、选择器
jQuery( selector, [ context ] )
①只有selector
jqueryObj = $('div.foo')
②只有context
jqueryObj = $(this)
③既有selector,也有context。
二、html
jQuery( html, [ ownerDocument ] )
①jQuery(‘html字符串’)
②jQuery(‘html字符串’,{
val:...,
type:...
})
三、jQuery(function(){
}) = $(document).ready()

浙公网安备 33010602011771号