<! 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> Add hyperlink </title>
</Head>
<Body>
<Div id = "divContent">
<P>
1. Men are philosophy and women are poetry. Philosophy without poetry is boring, and poetry without philosophy is superficial. Philosophy is rational and poetry is emotional. to read poetry, men must first understand their own philosophy. To understand philosophy, women must first understand their own poems, deep philosophy can only resonate with poems with appropriate charm, so the best is not necessarily suitable for you, and the best is the best for you. </P>
</Div>
<Br/>
<Div id = "divtest">
<P>
2. feixue shot the White Deer in the sky, and the smiling God is leaning against biyun! </P>
</Div>
<Input type = "button" onclick = "javascript: test (event);" value = "add link"/>
<Script>
Function test (e) {// other browsers
If (e.tar get ){
Var a = window. getSelection (). getRangeAt (0 );
Var B = a. toString ();
Var z = document. createElement ("span ");
Bb = B. link ("http://www.cecb2b.com/nic/" + a + ". html ");
Z. innerHTML = B;
A. deleteContents ();
A. insertNode (z );
}
Else {// IE browser
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>
From Lee.'s column