仿浏览器CTRL+F页内查找功能,JS代码如下
var n = 0; function findInPage(str) { if (document.all) { var txt, i, found; if (str == ""){ return false; } txt =document.body.createTextRange(); for (i = 0; i <= found="txt.findText(str))"> 0) {n = 0;findInPage(str);}}return false;}else{//谷歌循环查找window.find(str,false,true);}}</=>