web前端|js教程
输入框,匹配,字符
web前端-js教程
html
会员文章系统源码,vscode设置代码行距,ubuntu扩大磁盘,tomcat脚本目录下,node爬虫++视频,php有哪些扩展,长治seo网络营销降价,精良cms网站管理系统,dw网页制作模板下载lzw
源码,ubuntu 开机批处理,tomcat8.5 配置环境,进行图书爬虫,php中button按钮,百度推广怎么找代理商seo公司lzw
输入框自动匹配字符~
python网站框架源码下载,ubuntu关闭集显,tomcat常用配置文件,查看爬虫进度,PHP 显示列表信息 代码,凯歌seolzw
但是遇到一个问题~所有匹配的字符要事先写好~大概如果是大型网站的话~应该是利用数据库的记录吧
看代码
html
ul,li{margin: 0; padding: 0;width:100%;}
function checkword()
{
var wordvalue=document.getElementById("word").value.toLowerCase();
var alltxt="all|big|cut|car\|daph8|eeg|egg|eat|fuck|fuck you|fix|good|hand|hidden|ill|jack|jad|kevin|long|man|number|oio|part|pp|quit|QQ|rest|reg|set|submit|time|tag|uuzo|view|windows|want|xy|xun|young|yuyu|z|David|David|哈哈|";//这里就是你所想要匹配的字符,可惜只能用于小型的论坛
var alltxtalltxtpp=alltxt.toLowerCase();
var alltxtalltxt_xiang=alltxt.split("|");
var alltxt_xiang1=alltxtpp.split("|");
var inhtml=""
var isyou=0;
for (i=0;i {
if (alltxt_xiang1[i].substr(0,wordvalue.length)==wordvalue)
{
inhtmlinhtml=inhtml+""+alltxt_xiang[i]+"";
isyou=1;
}
}
inhtmlinhtml=inhtml+"";
if (isyou==1)
{
document.getElementById("showmenu").innerHTML=inhtml;
document.getElementById("showmenu").style.display="";
}
else
{
document.getElementById("showmenu").innerHTML="";
document.getElementById("showmenu").style.display="none";
}
if (wordvalue=="")
{
document.getElementById("showmenu").innerHTML="";
document.getElementById("showmenu").style.display="none";
}
}