日期:2014-05-16 浏览次数:20367 次
<script language="javascript"> var a="aaa <img onMouseOver=this.style.cursor='pointer' src='images/JoinContact.gif' title='abcdff'> bbb" alert(a) alert(a.replace(/^.*? title=\'([^\']*?)\'.*?$/i,"$1")) </script>
------解决方案--------------------
/title\s*=\s*[\s\S]+?(\'|\")/ig
------解决方案--------------------
把IMG加个ID
var title = getElementById("IMGID").getAttribute("title");