Tuesday, 24 May 2016

Making a Search bar


<!DOCTYPE html>
<html>
<body>

<p>Write something in the search field and press "ENTER".</p>

<input type="search" id="myInput" onsearch="myFunction()">

<p id="demo"></p>

</body>
</html>


function myFunction() {
   var x = document.getElementById("myInput");
   console.log(x.value)
}

No comments:

Post a Comment