<div class="form-field"> <label for="greeting">Your greeting</label> <input type="text" id="greeting" name="greeting" value="" /> </div> </form> <p id="greeting-message"></p> </body> <script> var greetingMessage = document.getElementById('greeting'); greetingMessage.addEventListener('keyup', function(e) { document.getElementById('greeting-message').innerText = e.target.value; }, false); </script> </html>