Js实现 clrt+f JavaScript
<script type="text/javascript">
var DOM = (document.getElementById) ? 1 : 0;
var NS4 = (document.layers) ? 1 : 0;
var IE4 = 0; if (document.all) { IE4 = 1; DOM = 0; }
var win = window;
var n = 0;
function findIt() {
if (document.getElementById("searchstr").value != "")
findInPage(document.getElementById("searchstr").value);
}
function findInPage(str) {
var txt, i, found;
if (str == "")
return false;
if (DOM) {
win.find(str, false, true);
return true;
}
if (NS4) {
if (!win.find(str))
while (win.find(str, false, true))
n++;
else
n++;
if (n == 0)
alert("未找到指定内容.");
}
if (IE4) {
txt = win.document.body.createTextRange();
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
} else {
if (n > 0) {
n = 0;
findInPage(str);
} else
alert("未找到指定内容.");
}
}
return false;
}
</script>
<input type="text" class="edit_seachrTxt" id="searchstr" name="searchstr" />
<label class="lableBtn"><input type="button" class="edit_seachrBtn" value="查找并选择" onclick="javascript:findIt()" /></label>
uniapp,常用工具函数 APP
在移动应用开发中,数据缓存是非常重要的一环。uni.getstorage作为uni-app的内置缓存API,提供了非常方便的数据存储能力。本篇文章将由以下几个方面进行详细的阐述,包括uni.getStorageSync, uni.getStorageInfoSync, uni.getStorageInfo, uni.getStorageSync缓存问题,旨在帮助读者深入了解uni.getstorage的使用和注意事项。
WIN10企业版LTSC如何激活 DEMO
WIN10企业版LTSC如何激活?win10企业版ltsc又被称为win10企业版2019长期服务版本,下文中为大家带来了win10企业版ltsc激活密钥及使用密钥教程,小编亲测有效,感兴趣的朋友不妨阅读下文内容,参考一下吧
标签: 实例
select选择跳转 CSS
<select name="archive_chrono" onchange="window.location =(document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);"> <option value="">请选择</option> <option value="http://www.baidu.com">百度</option> <option value="http://www.163.com">网易</option> <option value="http://www.taobao.com">淘宝</option> </select>
标签: css
js过滤HTML标签完整实例 DEMO
这篇文章主要介绍了js过滤HTML标签实现方法,以完整实例形式分析了JavaScript使用正则表达式过滤HTML标签的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
js实现页面打开自动定位到指定元素位置 JavaScript
类似页面抛点
<div class="more-merchant" id="moreMerchant"></div>
document.getElementById("moreMerchant").scrollIntoView()
标签: 实例