I wanted to make a form but not use <form>
because I want to send inputs
to ajax
. The problem is that if you take the form, it will not be required because as you said in W3Schools
The required attribute specifies that a
input
must be filled before to be submitted
So, what can I do to achieve this? I searched and found this code:
document.getElementById('put_id_here').validity.valid;
But the above code did not work.