title: How to check if the text is missing a certain character?
body: <p>The task that I'm working on has an div where you need to input your email. It's a simple task, it only needs to check if the email is missing @ and a period, and then display certain text, nothing too complicated. But, I've tried using the includes() function and the Chrome Console thing displays an error saying that varname.includes() it's not a function.</p>
  <p>Here's part of my HTML code where the JavaScript should take place after using onlick:</p>
  <pre><code>&lt;div class=&quot;warning&quot;&gt; &lt;/div&gt;
  
  &lt;div class=&quot;email&quot;&gt;
    &lt;input class=&quot;mail&quot; type=&quot;email&quot; name=&quot;mail&quot; placeholder=&quot;your email&quot;&gt;
    &lt;input class=&quot;send&quot; type=&quot;submit&quot; name=&quot;send&quot; value=&quot;SEND&quot; onclick=&quot;checkEmail()&quot;&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Bascially, what the JavaScript code needs to do is:</p>
  <ol>
  <li>If it's missing @, write &quot;missing @&quot; in the warning div.</li>
  <li>If it's missing ., write &quot;missing .&quot; in the warning div.</li>
  <li>If it's missing both @ and ., write &quot;Your email address is not correct!&quot; in the warning div.</li>
  <li>If the email meets both criteria, it makes an alert saying &quot;You are in!&quot;</li>
  </ol>
  <p>As I mentioned, I tried using includes() within an if, which didn't work, and I have no clue what else would work here. I know basics like how to make an alert or write text, I just don't know how to make the code check if the characters are there or missing. Any help on this would be greatly appreciated!</p>