<a href="javascript:search()" onclick="">查询</a>
要写在onclick中不需要javascript指令
<a href="#" onclick="search()return false">查询</a>
<HEAD><TITLE>如何通过JS实现鼠标经过图片1.gif 2.gif 3.gif 4.gif的时候动态的提取这些图片的title指到box2中 </TITLE>
<style type="text/css">
.on{padding15px 10pxfont-weightboldcolorred}
.off{padding0px 0pxfont-weightthincolorblack}
</style>
<script type="text/javascript" src="jquery-1.8.0.js"></script>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script>
jQuery(function($) {
$('#box img').each(function(){
$(this).bind('mouseenter mouseleave',function(){
var t = '|'+this.title+'|'
if($("#box2").text().indexOf(t)==-1)
{
$("#box2").text($("#box2").text()+t)
}
})
})
})
</script>
</HEAD>
<BODY>
<div class="box" id="box">
<a href="#" class="pic1">
<img src="mouse_drag\images\b.gif" title="1" />
</a>
<a href="#" class="pic2">
<img src="mouse_drag\images\b.gif" title="2" />
</a>
<a href="#" class="pic3">
<img src="mouse_drag\images\p.gif" title="3" />
</a>
<a href="#" class="pic4">
<img src="mouse_drag\images\g.gif" title="4" />
</a>
</div>
<div class="box2" id="box2"></div>
</BODY>
欢迎分享,转载请注明来源:优选云