Why do we need a function and a button to get user input from a textarea element?

<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 itBecause we want to display things in the consoleBecause 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.