87,907
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.adKeyword {
color: #FF0000;
}
-->
</style>
</head>
<body>
<div id="qq">中国 </div>
中国
</body>
</html>
<script language="JavaScript" type="text/javascript"><!--
if(document.createRange){
var range = document.createRange();
}else
var range = document.body.createTextRange();
if(range.findText){
while(range.findText("中国")){
range.pasteHTML('<a href="http://www.china.com"><font color="red">'+range.text+'</font></a>');
range.collapse(true);
}
}else{
var s,n;
s = window.getSelection();
while(window.find("中国")){
var n = document.createElement("a");
n.href="http://www.china.com"
n.style.color="#ff0000"
s.getRangeAt(0).surroundContents(n);
}
}
//--></script>