サマリー:<!DOCTYPE html><html><head> <meta charset="utf-8"> <title></title> <style type="text/css"> /*p{margin: 0px;}*/ </style> <script
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
/*p{margin: 0px;}*/
</style>
<script type="text/javascript" src="./jquery.js"></script>
</head>
<body>
<h1>jquery包節(jié)點(diǎn)</h1>
<input type="button" value="用p標(biāo)簽包住每個(gè)input" onclick="wp()" />
<input type="button" value="用p標(biāo)簽包住所有input" onclick="wpa()" />
<input type="button" value="li中的文字加粗" onclick="cu()" />
<input type="text" name="" id=""/>
<input type="text" name="" id=""/>
<input type="text" name="" id=""/>
<ul>
<li>春</li>
<li>夏</li>
<li>秋</li>
<li>東</li>
</ul>
</body>
<script type="text/javascript">
function wp() {
$("input:text").wrap('<p></p>');
}
function wpa() {
$("input:text").wrapAll('<p></p>');
}
function cu() {
$("li").wrapInner('<b><b>');
}
</script>
</html>
添削の先生:韋小寶添削時(shí)間:2019-03-05 16:13:29
先生のまとめ:寫的很不錯(cuò) jQuery基礎(chǔ)還是比較重要的 之前js學(xué)的不差的話學(xué)起來應(yīng)該是沒有什么難度的