index.jsp代码:
运行结果:
[img]http://dl2.iteye.com/upload/attachment/0085/3695/647cc8b8-8080-375d-b401-55e505141ab7.jpg[/img]
点击button按钮之后,效果如下:
[img]http://dl2.iteye.com/upload/attachment/0085/3697/fc12368d-f2e5-3b9b-a6a4-8e48c164be84.jpg[/img]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jquery</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="javascript/jquery-1.4.js">
</script>
<script type="text/javascript" src="javascript/elements.js">
</script>
<script type="text/javascript" src="javascript/jqia2.support.js">
</script>
<script type="text/javascript">
function one(){
$('#dimg img').remove();
}
</script>
</head>
<body>
<div id="dimg">
<img src="images/image.1.jpg" id="hibiscus" alt="Hibiscus" />
<img src="images/image.2.jpg" id="littleBear"
title="A dog named Little Bear" />
<img src="images/image.3.jpg" id="verbena" alt="Verbena" />
<img src="images/image.4.jpg" id="cozmo" title="A puppy named Cozmo" />
<img src="images/image.5.jpg" id="tigerLily" alt="Tiger Lily" />
<img src="images/image.6.jpg" id="coffeePot" />
<img src="images/image.6.jpg" id="coffeePot" />
</div>
<div>
<input type="button" onclick="one()" value="button">
</div>
</body>
</html>
运行结果:
[img]http://dl2.iteye.com/upload/attachment/0085/3695/647cc8b8-8080-375d-b401-55e505141ab7.jpg[/img]
点击button按钮之后,效果如下:
[img]http://dl2.iteye.com/upload/attachment/0085/3697/fc12368d-f2e5-3b9b-a6a4-8e48c164be84.jpg[/img]