wrap
English[r?p] US[r?p]
vt. Wrap; ?(?? ?, ?? ?)... , ??, ???; vi. ??, ??(?? over, around ?? ?? ???); ???, ???(? ?) . ??, ??; ??
n. ??, ??
jquery WrapInner() ??? ???
??: wrapInner() ???? ??? HTML ??? ?? ??? ???? ??? ? ??? ?? ???(?? HTML)? ?????.
??: ??$(selector).wrapInner(wrapper)
????:
???? | Description |
wrapper | ?????. ??? ??? ???? ???? ???? ?????. ??? ?: HTML ?? - ?: ("<div></div>") ? DOM ?? - ?: (document.createElement("div")) ?? ?? - ?: ($(".div1" )) ????? ??? ??? ?? ???? ?? ? ?????. |
??? ???? ??? ??: ??? ???? ??? ? ??? ???? ???? ?????.
??: ??$(selector).wrapInner(function())
????:
Parameters | Description |
function() | ?????. ?? ??? ???? ??? ?????. |
jquery WrapInner() ??? ?
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".btn1").click(function(){ $("p").wrapInner("<b></b>"); }); }); </script> </head> <body> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <button class="btn1">加粗段落中的文本</button> </body> </html>
??? ????? ??? "???? ??" ??? ?????