jquery基础练习

原创 2019-03-05 14:38:56 324
摘要:<!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包节点</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 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>


批改老师:韦小宝批改时间:2019-03-05 16:13:29
老师总结:写的很不错 jQuery基础还是比较重要的 之前js学的不差的话学起来应该是没有什么难度的

发布手记

热门词条