<head> <title>无标题页</title> <style type="text/css"> body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;} body,input,button,select,textarea{font-size:14px;font-family:Tahoma,Geneva,Verdana;outline:none;} body{margin:0;padding:0; font-size:12px; background-color:#f3f3f3} .clear{clear:both;} a{text-decoration:none;} a:hover{text-decoration:none ;} img{border:0} ol,ul{list-style:none;} div{ margin:0} /*搜索区*/.search_background{ height:21px; width:150px; background-color:#ffffff; float:left;border:0; color:#cacacc;margin:5px 0 0 5px;display:inline}.search_background .input_text{ float:left}.search_background .input_text input{ width:124px; height:20px; font-size:12px; line-height:20px;padding:0 3px 0 3px; border:0;}.search_background .search_button{ float:right; display:inline}.search_background .search_button a{ margin:3px 3px 0 0 } /*搜索下拉*/.search_ifo{width:149px;border: 1px solid #999; background-color:#fff;margin-top:30px;margin-left:-150px;float:left}.search_public{background:url(../images/short_dotted_line.png) repeat-x; height:25px;line-height:25px; text-indent:1em;}.search_public:hover{background-color:#e1e1e1;cursor:pointer;}.search_tip{height:30px;line-height:30px;color:#0098E1}.search_tip:hover{background-color:#e1e1e1;cursor:pointer;} </style></head><body><div> <div class="search_background"> <div class="input_text"><input type="text" /></div> <div class="search_button"><a href="#"> <img src="/static/imghwm/default1.png" data-src="images/individual-headerandfooter/search.png" class="lazy" / alt="Search drop-down box solution_html/css_WEB-ITnose" ></a></div> </div><div class="search_ifo"><div style="max-width:90%"> <div class="search_tip"> 搜“<span style="color:Red;">白</span>”相关信息»</div> <div class="search_public" ><span style="color:Red;">白</span>啊</div> <div class="search_public"><span style="color:Red;">白</span>啊</div> </div> </div> </div></body>
就是想在输入框输入字符后,下拉框显示相应的信息,比如说输入 白下拉框显示搜 白相关信息、再在下面显示相关白的信息列表
回复讨论(解决方案)
这是有个插件的,我前段时间还帮别人搞了个,只是里面有些修改的,是别人做的。
例子:http://s.dingso.com/ds.jsp?q1=设计玩具&q2=&q3_1=&q3_2=&q3_3=&q4=&Sortt=2&Periodd=3&startat=0
google 一个这个:autocomplete 就知道了
就是发ajax返回结果集后操作页面显示
nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script> <br /> <!-- <br /> <br /> // script by blueDestiny <br /> // email : blueDestiny [at] 126 . com <br /> <br /> // Object: jsAuto <br /> // browser: ie, mf. <br /> // example: <br /> <br /> // step1 : <br /> // create autocomplete container, return object and bind event to the object, and <br /> ///create a new jsAuto instance: <br /> // <div id="divautocomplete"> <br /> // var autocomplete = new jsAuto("autocomplete","divautocomplete") <br /> // handle event: <br /> // autocomplete.handleEvent(value, returnObjectID) <br /> // <input id="rautocomplete" onkeyup="autocomplete.handleEvent(this.value,"ratocomplete",event)> <br /> <br /> // step2 : <br /> // add autocompete item: <br /> // autocomplete.item(string) <br /> // string must be a string var, you can split the string by "," <br /> // autocomplete.item("blueDestiny,never-online,csdn,blueidea") <br /> <br /> // http://www.never-online.com <br /> <br /> function jsAuto(instanceName,objID) <br /> { <br /> this._msg = []; <br /> this._x = null; <br /> this._o = document.getElementById( objID ); <br /> if (!this._o) return; <br /> this._f = null; <br /> this._i = instanceName; <br /> this._r = null; <br /> this._c = 0; <br /> this._s = false; <br /> this._v = null; <br /> this._o.style.visibility = "hidden"; <br /> this._o.style.position = "absolute"; <br /> this._o.style.zIndex = "9999"; <br /> this._o.style.overflow = "auto"; <br /> this._o.style.height = "50"; <br /> return this; <br /> }; <br /> <br /> jsAuto.prototype.directionKey=function() { with (this) <br /> { <br /> var e = _e.keyCode ? _e.keyCode : _e.which; <br /> var l = _o.childNodes.length; <br /> (_c>l-1 || _c<0) ? _s=false : ""; <br /> <br /> if( e==40 && _s ) <br /> { <br /> _o.childNodes[_c].className="mouseout"; <br /> (_c >= l-1) ? _c=0 : _c ; <br /> _o.childNodes[_c].className="mouseover"; <br /> } <br /> if( e==38 && _s ) <br /> { <br /> _o.childNodes[_c].className="mouseout"; <br /> _c--<=0 ? _c = _o.childNodes.length-1 : ""; <br /> _o.childNodes[_c].className="mouseover"; <br /> } <br /> if( e==13 ) <br /> { <br /> if(_o.childNodes[_c] && _o.style.visibility=="visible") <br /> { <br /> _r.value = _x[_c]; <br /> _o.style.visibility = "hidden"; <br /> } <br /> } <br /> if( !_s ) <br /> { <br /> _c = 0; <br /> _o.childNodes[_c].className="mouseover"; <br /> _s = true; <br /> } <br /> }}; <br /> <br /> // mouseEvent. <br /> jsAuto.prototype.domouseover=function(obj) { with (this) <br /> { <br /> _o.childNodes[_c].className = "mouseout"; <br /> _c = 0; <br /> obj.tagName=="DIV" ? obj.className="mouseover" : obj.parentElement.className="mouseover"; <br /> }}; <br /> jsAuto.prototype.domouseout=function(obj) <br /> { <br /> obj.tagName=="DIV" ? obj.className="mouseout" : obj.parentElement.className="mouseout"; <br /> }; <br /> jsAuto.prototype.doclick=function(msg) { with (this) <br /> { <br /> if(_r) <br /> { <br /> _r.value = msg; <br /> _o.style.visibility = "hidden"; <br /> } <br /> else <br /> { <br /> alert("javascript autocomplete ERROR :nn can not get return object."); <br /> return; <br /> } <br /> }}; <br /> <br /> // object method; <br /> jsAuto.prototype.item=function(msg) <br /> { <br /> if( msg.indexOf(",")>0 ) <br /> { <br /> var arrMsg=msg.split(","); <br /> for(var i=0; i<arrMsg.length; i ) <br /> { <br /> arrMsg[i] ? this._msg.push(arrMsg[i]) : ""; <br /> } <br /> } <br /> else <br /> { <br /> this._msg.push(msg); <br /> } <br /> this._msg.sort(); <br /> }; <br /> jsAuto.prototype.append=function(msg) { with (this) <br /> { <br /> _i ? "" : _i = eval(_i); <br /> _x.push(msg); <br /> var div = document.createElement("DIV"); <br /> <br /> //bind event to object. <br /> div.onmouseover = function(){_i.domouseover(this)}; <br /> div.onmouseout = function(){_i.domouseout(this)}; <br /> div.onclick = function(){_i.doclick(msg)}; <br /> var re = new RegExp("(" + _v + ")","i"); <br /> div.style.lineHeight="140%"; <br /> div.className = "mouseout"; <br /> if (_v) div.innerHTML = msg.replace(re , "<strong>$1"); <br /> div.style.fontFamily = "verdana"; <br /> <br /> _o.appendChild(div); <br /> }}; <br /> jsAuto.prototype.display=function() { with(this) <br /> { <br /> if(_f&&_v!="") <br /> { <br /> _o.style.left = _r.offsetLeft; <br /> _o.style.width = _r.offsetWidth; <br /> _o.style.top = _r.offsetTop + _r.offsetHeight; <br /> _o.style.visibility = "visible"; <br /> } <br /> else <br /> { <br /> _o.style.visibility="hidden"; <br /> } <br /> }}; <br /> jsAuto.prototype.handleEvent=function(fValue,fID,event) { with (this) <br /> { <br /> var re; <br /> _e = event; <br /> var e = _e.keyCode ? _e.keyCode : _e.which; <br /> _x = []; <br /> _f = false; <br /> _r = document.getElementById( fID ); <br /> _v = fValue; <br /> _i = eval(_i); <br /> re = new RegExp("^" + fValue + "", "i"); <br /> _o.innerHTML=""; <br /> <br /> for(var i=0; i<_msg.length; i++) <br /> { <br /> if(re.test(_msg[i])) <br /> { <br /> _i.append(_msg[i]); <br /> _f = true; <br /> } <br /> } <br /> <br /> _i ? _i.display() : alert("can not get instance"); <br /> <br /> if(_f) <br /> { <br /> if((e==38 || e==40 || e==13)) <br /> { <br /> _i.directionKey(); <br /> } <br /> else <br /> { <br /> _c=0; <br /> _o.childNodes[_c].className = "mouseover"; <br /> _s=true; <br /> } <br /> } <br /> }}; <br /> window.onerror=new Function("return true;"); <br /> //--> <br /> </script>
Autocomplete Function
Power By Miracle, never-online
<script> <br /> <!-- <br /> var jsAutoInstance = new jsAuto("jsAutoInstance","divc"); <br /> jsAutoInstance.item("a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start,a-start,b-start,c-start,d-start,e-start,f-start,g-start,h-start,i-start,j-start,k-start,l-start,m-start,n-start,o-start,p-start,q-start,r-start,s-start,t-start,u-start,v-start,w-start,x-start,y-start,z-start,z-start"); <br /> jsAutoInstance.item("blueDestiny"); <br /> jsAutoInstance.item("BlueMiracle,Blue"); <br /> jsAutoInstance.item("angela,geniuslau"); <br /> jsAutoInstance.item("never-online"); <br /> //--> <br /> </script>
谢谢大家了,希望有人可以根据我提供的信息编写一段,麻烦了!

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
