<!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>
<title> </title>
</head>
<body>
<div id="divContent">
<p>
1、 , 。 , 。 , , , , , , , 。</p>
</div>
<br />
<div id="divtest">
<p>
2、 , !</p>
</div>
<input type="button" onclick="javascript:test(event);" value=" " />
<script>
function test(e) {//
if (e.target) {
var a = window.getSelection().getRangeAt(0);
var b = a.toString();
var z = document.createElement("span");
b = b.link("http://www.cecb2b.com/nic/" + a + ".html");
z.innerHTML = b;
a.deleteContents();
a.insertNode(z);
}
else { //ie
var text = document.getElementById("divContent").innerHTML;
var t = document.selection.createRange();
t.pasteHTML("<a href='http://www.cecb2b.com/nic/" + t.text + ".html'>" + t.text + "</a>");
}
}
</script>
</body>
</html>