时间:2021-07-01 10:21:17 帮助过:4人阅读
Javascript代码
<script>
window.onload=function(){
var div = document.getElementById("container");
var s=div.innerHTML;
var re = /(http:\/\/[\w.\/]+)(?![^<]+>)/gi;
div.innerHTML=s.replace(re,"<a href='$1' target='_blank'>$1</a>");
}
</script>