diff --git "a/33\347\275\227\346\255\244\344\270\234/2022.12.1/1.html" "b/33\347\275\227\346\255\244\344\270\234/2022.12.1/1.html" new file mode 100644 index 0000000000000000000000000000000000000000..310d20056f9dfbe96ee7107c5745c52e97a61a3b --- /dev/null +++ "b/33\347\275\227\346\255\244\344\270\234/2022.12.1/1.html" @@ -0,0 +1,24 @@ + + + + + + + Document + + + + + + + \ No newline at end of file diff --git "a/33\347\275\227\346\255\244\344\270\234/2022.12.1/JQuery\346\226\271\346\263\225.md" "b/33\347\275\227\346\255\244\344\270\234/2022.12.1/JQuery\346\226\271\346\263\225.md" new file mode 100644 index 0000000000000000000000000000000000000000..42ccc8d1c1a158931b15e45b25a19aea62fd2cfd --- /dev/null +++ "b/33\347\275\227\346\255\244\344\270\234/2022.12.1/JQuery\346\226\271\346\263\225.md" @@ -0,0 +1,40 @@ +# JQuery方法 + +eq():跟据下标找元素,从0开始 + +$('').eq() + + + +detach():保留事件 + +```js + var $btn = $('button').eq(2).detach(); + $('button').eq(1).click(function () { + $(this).after($btn); + }) +``` + + + +clone(bool):返回一个复制元素,默认是false:只克隆元素。不克隆事件,参数为bool=true:表示将事件一起复制, + +```js + $('button').eq(4).click( + function () { + var $btn3 = $('button').eq(2).clone(true); + $(this).after($btn3); + } + ) +``` + + + +replaceWith():替换jQuery对象 + +```js +$('button').eq(3).replaceWith($('')) +``` + + +