Blogger Information
Blog 16
fans 1
comment 0
visits 10052
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0404作业
烟火的博客
Original
606 people have browsed it

实例

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>


	<a href="www.sina.com" id='gg' data-zidingyi="ziji">公告</a>
</body>
</html>

<!-- 引入jquery -->
<script type="text/javascript" src="../jquery-3.3.1.js"></script>
<script type="text/javascript">
// 锁定目标
	var res=$('a').attr()
	// 将目标的属性值修改
	var res = $('#gg').attr('href','wwww.baidu.com')
	var res = $('#gg').attr('data-zidingyi')

// 移除属性值removeAttr
	$('#gg').removeAttr('style')
	var res = $('#gg').removeAttr('alt title data-zidingyi')
</script>

运行实例 »

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


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