jQuery包结点
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>jQuery包结点</h1>
<input type="button" value="用p标签包住每个input" onclick="wp()" />
<input type="button" value="用p标签包住所有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 src="jquery.js"></script>
<script>
// input竖直排列
function wp() {
$('input:text').wrap('<p></p>');
}
// input横向排列
function wpa() {
$('input:text').wrapAll('<p></p>');
}
// li标签中文字加粗
function cu() {
//$('li').wrap('<b></b>');
$('li').wrapInner('<b></b>');
}
</script>
</html>
input竖直排列

input横向排列

li标签中文字加粗
