I am new to Javascript and I've got a Register form that I need users to fill in. I have a separate script to check whether their username and e-mail addresses have already been used, but I want the submit button to be disabled until all the fields have been filled out and the email and username is valid.
I have a separate div tag for displaying the email and username errors, but they are empty if there is no error. How would I check to see if there is no text inside the div tags.
This is what I have tried but it's clearly not right:
Expand|Select|Wrap|Line Numbers
- var DivEmail = document.getElementById('emailcheck')
- if(DivEmail.innerText !== null)
- {
- ++count;
- }
Thanks for your help!