<html>
<head><style>body {min-height: 300px;} input { font-size: 16px; } textarea { font-size: 16px; } </style></head>
<body>
<input id="searchInput" type="text" placeholder="Search">
<button onclick="search()">Search</button>
<p id="message"></p>
<script>function search() {
var searchWord = document.getElementById("searchInput").value;
document.getElementById("message").innerHTML = searchWord;
}</script>
</body>
</html>]]>Make sure to assemble .innerHTML = searchWord
.