要完成此效果需要两个步骤 第一步:把如下代码加入到<head>区域中 <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var text = ""; function getActiveText(e) { text = (document.all) ? document.selection.createRange().text : document.getSelection(); document.theform.text.value = text; return true; } document.onmouseup = getActiveText; if (!document.all) document.captureEvents(Event.MOUSEUP); // End --> </script> 第二步:把如下代码加入到<body>区域中 <center> <form name=theform> 被选中的文本: <input type=text name=text value=""> </form> </center> 载入中... 载入中...
Copyright © 2000-2006 Nkcn.Net 天津网站优化 All Rights Reserve.