Blogger Information
Blog 14
fans 0
comment 0
visits 8965
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
jquery的引用和写法
大熊的php博客
Original
435 people have browsed it

代码 


实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js的几种饮用方式</title>
	<style type="text/css" media="screen">
		.box{ width: 500px ;height: 300px; border: 1px ;  margin: auto; }
		.li1 { float: left;  }
	</style>
</head>

<script type="text/javascript" src="../js/jquery-3.3.1.js"></script> <!-- 本地引用方法 -->
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
 <!-- 引用CDN的方法 -->

<body>
	<div class="box">
	<h2>购物清单</h2>
	<ul id="list">
	<li>生活用品
		<ul>
			<li><a href="">淘宝</a></li>
			<li>箱包</li>
			<li>衣服</li>
			<li>鞋子</li>
		</ul>
	</li>
	<li>数码产品
		<ul>
			<li><a href="">京东</a></li>
			<li>笔记本电脑</li>
			<li>显示器</li>
		</ul>
	</li>
	<li>食品保健
		<ul>
			<li><a href="">拼多多</a></li>
			<li>奶粉</li>
			<a href="">玩具</a>
		</ul>
	</li>
</ul>

</div>
<script type="text/javascript">





</script>

<script type="text/javascript">
	// $('#list > li').addClass('horiz')
	$(document).ready(function(){
	
	$('#list > li').addClass('li1')
	 })
</script>	
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

3.png

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post