可以参照下面的例子:
<HTML>
<BODY>
Leonardo da Vinci was one of the great masters of the High
Renaissance, especially in painting, sculpture, architecture,
engineering, and science.<br />
<input type="button" value="tttttttttttt" onclick="t();">
</BODY>
</HTML>
<SCRIPT>function t()
{
var oRange = document.body.createTextRange();/*你可以试着取到你要查找的窗口对象,其它的就参照下面的**/
var fres = oRange.findText('leo');
oRange.select();
}
</SCRIPT>
<HTML>
<BODY>
Leonardo da Vinci was one of the great masters of the High
Renaissance, especially in painting, sculpture, architecture,
engineering, and science.<br />
<input type="button" value="tttttttttttt" onclick="t();">
</BODY>
</HTML>
<SCRIPT>function t()
{
var oRange = document.body.createTextRange();/*你可以试着取到你要查找的窗口对象,其它的就参照下面的**/
var fres = oRange.findText('leo');
oRange.select();
}
</SCRIPT>
up up