<input type="text" size="40" id="search" onkeyup="searchVal()">
<script>
function searchVal(){
console.log(search.value);
var xhr = new XMLHttpRequest();
xhr.open('GET', './php/sql.php?input='+document.getElementById("search").value, true);
if(xhr.status != 200){
console.log( xhr.status + ': ' + xhr.statusText );
}else{
console.log(xhr.responseText );
}
xhr.send();
};
</script>