slice
?? [sla?s]
vt.????;????
n?? ??;
jquery ????() ??? ???
??: slice()? ???? ?? ??? ??? ??? ??? ?? ???? ????.
??: ??.slice(selector,end)
????:
???? | ?? |
selector | 0? ???? ?? ?? ? ??? ??? ???? ??? ??. ??? ?? ??? ???? ???? ?????. |
end | ??? ??? ??? ??? ???? 0?? ???? ?? ????. ??? ?? ??? ???? ???? ?????. ???? ??? ??? ??? ?????. |
??: DOM ?? ???? ???? jQuery ??? ?? ?? .slice() ???? ???? ??? ?? ??? ???? ? jQuery ??? ?????. ??? ??? ???? ??? ?? ?????. end ????? ???? ??? ?? ?? ??? ??? ?????.
jquery ????() ??? ?
<!DOCTYPE html> <html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> </head> <body> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <p>This is a paragraph.</p> <script> $("p").slice(0, 2).wrapInner("<b></b>"); </script> </body> </html>
??? ????? ??? "???? ??" ??? ?????