Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h2>The XMLHttpRequest Object</h2>
<h3>Start typing a name in the input field below:</h3>
<p>Suggestions: <span id="txtHint"></span></p> 
<p>First name: <input type="text" id="txt1" onkeyup="showHint(this.value)"></p>
<script>
function showHint(str) {
  if (str.length == 0) { 
    document.getElementById("txtHint").innerHTML = "";
    return;
  }
  const xhttp = new XMLHttpRequest();
  xhttp.onload = function() {
    document.getElementById("txtHint").innerHTML =
    this.responseText;
  }
  xhttp.open("GET.html", "gethint03d2.html?q="+str);
  xhttp.send();   
}
</script>
</body>
<!-- Mirrored from www.mdssup.ma/js/tryit.asp?filename=tryjs_ajax_suggest_php by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 14:47:00 GMT -->
</html>