diff --git "a/18 \345\276\220\346\260\270\346\267\263/20231212\347\254\224\350\256\260.md" "b/18 \345\276\220\346\260\270\346\267\263/20231212\347\254\224\350\256\260.md" new file mode 100644 index 0000000000000000000000000000000000000000..26eab21f537ec9fd7a9d812b1f5286112e525216 --- /dev/null +++ "b/18 \345\276\220\346\260\270\346\267\263/20231212\347\254\224\350\256\260.md" @@ -0,0 +1,300 @@ + jQuery 语法实例 + +- [$(this).hide()](https://gitee.com/link?target=https%3A%2F%2Fwww.w3school.com.cn%2Ftiy%2Ft.asp%3Ff%3Djquery_hide_this) + + 演示 jQuery hide() 函数,隐藏当前的 HTML 元素。 + +- [$("#test").hide()](https://gitee.com/link?target=https%3A%2F%2Fwww.w3school.com.cn%2Ftiy%2Ft.asp%3Ff%3Djquery_hide_id) + + 演示 jQuery hide() 函数,隐藏 id="test" 的元素。 + +- [$("p").hide()](https://gitee.com/link?target=https%3A%2F%2Fwww.w3school.com.cn%2Ftiy%2Ft.asp%3Ff%3Djquery_hide_p) + + 演示 jQuery hide() 函数,隐藏所有 + + 元素。 + +- [$(".test").hide()](https://gitee.com/link?target=https%3A%2F%2Fwww.w3school.com.cn%2Ftiy%2Ft.asp%3Ff%3Djquery_hide_class) + + 演示 jQuery hide() 函数,隐藏所有 class="test" 的元素。 + + ## jQuery 语法 + + jQuery 语法是为 HTML 元素的选取编制的,可以对元素执行某些操作。 + + 基础语法是:*$(selector).action()* + + - 美元符号定义 jQuery + - 选择符(selector)“查询”和“查找” HTML 元素 + - jQuery 的 action() 执行对元素的操作 + + ### 示例 + + $(this).hide() - 隐藏当前元素 + + $("p").hide() - 隐藏所有段落 + + $(".test").hide() - 隐藏所有 class="test" 的所有元素 + + $("#test").hide() - 隐藏所有 id="test" 的元素 + + **提示:**jQuery 使用的语法是 XPath 与 CSS 选择器语法的组合。在本教程接下来的章节,您将学习到更多有关选择器的语法 + +```html + + +``` \ No newline at end of file