<html>
<head><style>body {min-height: 300px;} input { font-size: 16px; } textarea { font-size: 16px; } </style></head>
<body>
<input id="feedbackText" type="text" placeholder="Your feedback">
<button onclick="submit()">Submit</button>
<script>function submit() {
var feedback = document.getElementById("feedbackText").value;
console.log(feedback);
}</script>
</body>
</html>]]>- Because the element's
value
changes when a user interacts with it - Because we want to display things in the console
- Because we want to update the webpage
We need a button and a function because the textarea
element's value changes as a user interacts with it.