One of my form inputs is required:
<input type="text" id="input-id" required>
After the user submits it, I send the value using ajax and then clear it with
$("#input-id").val("")
.
However, after this action, the input appears invalid. I want to reset it to its original look as if the page just loaded. How can I achieve this using JavaScript? Is there a better way to clear the input?