What happens if we set an input element's value to an empty string ""?

<html>
<head><style>body {min-height: 300px;} input { font-size: 16px; } textarea { font-size: 16px; } </style></head>
<body>
  <input id="usernameInput" type="text" placeholder="Username">
  <button onclick="register()">Register</button>
  
  <script>function register() {
document.getElementById("usernameInput").value = "";
}</script>
</body>
</html>]]>
It removes the text inside the input field and shows the placeholder attribute's valueIt updates the placeholder attribute

Setting an input's value to an empty string will remove the text inside the input field and show the placeholder attribute's value.