Tryit Editor v1.4

<html> <head> <script type="text/javascript"> xmlHttp=null; function showHint(str) { if (str.length==0) { document.getElementById("txtHint").innerHTML=""; return; } try {// Firefox, Opera 8.0+, Safari, IE7 xmlHttp=new XMLHttpRequest(); } catch(e) {// Old IE try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert ("Your browser does not support XMLHTTP!"); return; } } url="gethint.asp@q=.htm" + str; url=url+"&sid="+Math.random(); xmlHttp.open("GET",url,false); xmlHttp.send(null); document.getElementById("txtHint").innerHTML=xmlHttp.responseText; } </script> </head> <body><form> First Name: <input type="text" id="txt1" onkeyup="showHint(this.value)"> </form><p>Suggestions: <span id="txtHint"></span></p> </body> </html> | Your Result:
Edit the code above and click to see the result. | W3Schools.com - Try it yourself