I have looked all over the internet to solve this but can’t find any answers. If I am not clear, here is what I want to remove:
Example code:
<form action="search.html" id="form">
<input type="text" placeholder="Search..." name="s" id="s" required>
<button type="submit">Submit</button>
</form>
Also, for the <input type="">, is it better to put type="search" rather than type="text" for what I’m doing?
If anything other than HTML needs to be used, no jquery if possible please.
>Solution :
You can use setCustomValidity:
<form action="search.html" id="form">
<input type="text" placeholder="Search..." name="s" id="s" oninvalid="this.setCustomValidity(' ')" required>
<button type="submit">Submit</button>
</form>
I’m not sure why you have to specify a space (" ") as the validity message, but it apparently gets ignored if you apply an empty string.
