<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script type="text/javascript" language="javascript">
function boldThis(from) { 
strSelection = document.selection.createRange().text 
if (strSelection == "") { 
return false; 

else document.selection.createRange().text = "<b>" + strSelection 
+ "</b>" 
return;
}
</script>
</head>
<body bgcolor="#0099FF" text="#FFFFFF">
<form name="form1" method="post" action="">
<textarea name="textarea" cols="50" rows="20">这里是测试文字,选中文字,然后可以在选中的文字两边加上代码,也可以自己输入要加入的东西。只需要再增加一个输入框即可。</textarea><br>
<input type="button" value="在选中的文字两边加上粗体标记" onclick="boldThis()">
</form>
</body>
</html>