jQuery 语法是为HTML元素的选取编制的,可以对元素执行某些操作。
基础语法是:$(selector).action()
美元符号定义jQuery 选择符(selector)"查询"和"查找"HTML元素 jQuery的action()执行对元素的操作
eg:
$(this).hide()- 隐藏当前元素
$(“p”).hide()- 隐藏所有段落
$(“.test”).hide()- 隐藏所有class = “test” 的所有元素
$(“#test”).hide()- 隐藏所有 id = “test” 的元素
新闻热点
疑难解答