正则获取图片地址,搬运工
<script type="text/javascript"> function myfunction() { var a = '<P><IMG src="http://bbs.cn.yimg.com/user_img/200701/31/jisuanji986_117025184198149.jpg" mce_src="http://bbs.cn.yimg.com/user_img/200701/31/jisuanji986_117025184198149.jpg"></P>' var b = /<img [^>]*src=['"]([^'"]+)([^>]*>)/gi var s = a.match(b) for (var i = 0; i < s.length; i++) { alert(s[i].replace(b, "$1")) } } </script>