日期:2014-05-16 浏览次数:20418 次
<a id="gallery1" onclick="ajaxhuansrc(gallery1)" href="javasript:void(0)" style="margin-top: 0px;" > <img width="65" height="85" src="images/201206/thumb_img/9_thumb_P_1339405391493.jpg" /></a>
<a id="gallery1" onclick="ajaxhuansrc(this)" href="javascript:void(0)" style="margin-top: 0px;"> <img width="65" height="85" src="images/201206/thumb_img/9_thumb_P_1339405391493.jpg" /> </a> <script type="text/javascript"> function ajaxhuansrc(obj) { alert(obj.getElementsByTagName('img')[0].src); } </script>
------解决方案--------------------
jquery.
$('img').attr('src');