Need help with client-side form validation

I turn to you with a request for help. I’m facing a little problem with a contact form. I wrote some JavaScript code to handle client-side validation, but how can I make the user see the errors under each field?

Here’s the code: