0

How can I amend this to check that x also contains @? I've tried using includes() but that does not work.

I realise this is probably simple but I just can't seem to get it

EDIT

using either includes() or indexof() results in this error:

"'); debugger" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.

 var x = document.getElementById('emailEntry').value;

    var doesContain = x.includes('@');

    if (x == null || x == "" || !doesContain) {
        document.getElementById('message').style.display = "block";
        document.getElementById('message').innerHTML = "Email must not be blank";
    }
DarkW1nter
  • 2,807
  • 9
  • 54
  • 107

0 Answers0