Access the value in the text field.

<html>
<head><style>body {min-height: 300px;} input { font-size: 16px; } textarea { font-size: 16px; } </style></head>
<body>
  <h3>Explore</h3>
  <input id="searchInput" type="text" placeholder="Search Instagram">
  <br>
  <button onclick="search()">Search</button>
  <script>function search() {
var searchTerm = document.getElementById("searchInput").value;
console.log("Searching Instagram for " + searchTerm);
}</script>
</body>
</html>]]>

Make sure to code .value.