title: How to add required on different form when button onclick
body: <p>Is it possible to add <code>required</code> on different form, before execute button?</p>
  
  <p>let say I have a HTML code when I used this code in JS:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
    $('#button1').click(function() {
      $("#email").prop('required', true);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;form&gt;
    &lt;input type="text" id="email" name="email" placeholder="Email*"&gt;
  &lt;/form&gt;
  &lt;form&gt;
    &lt;button id="button1"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>the button keep execute even the <code>textfield</code> of email is null,</p>
  
  <p>expected result: need to show this text if input field is null when click the button</p>
  
  <p><a href="https://i.stack.imgur.com/bXpy3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bXpy3.png" alt="required"></a></p>
  
  <p><a href="https://jsfiddle.net/9wbranL3/" rel="nofollow noreferrer">jsfiddle</a></p>