title: Redirecting to div
body: <p>am trying to redirect after submitting form</p>
  <p>from</p>
  <p>window.location = &quot;https://link/&quot;;</p>
  <p>to</p>
  <p>document.getElementById(&quot;the_div_id&quot;).scrollIntoView(true);</p>
  <p>but not working</p>
  <p>also to hide some div</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt; 
        function sendEmail() {
          var email = document.getElementById(&quot;email&quot;).value;
          var password = document.getElementById(&quot;password&quot;).value;
  
          if(email == &quot;&quot; || password == &quot;&quot;){
              document.getElementById(&quot;emailError&quot;).innerHTML = &quot;email is required&quot;;
              document.getElementById(&quot;passwordError&quot;).innerHTML = &quot;password is required&quot;;
              
              return false;
          }
  
          var email = document.querySelector('input[name=&quot;email&quot;]').value;
          var password = document.querySelector('input[name=&quot;password&quot;]').value;
          
          
          var emailBody = 'Welcome ' + email + ' ' + password;
          
          Email.send({ 
            Host: &quot;&quot;, 
            Username: &quot;&quot;, 
            Password: &quot;&quot;, 
            To: '', 
            From: &quot;&quot;, 
            Subject: &quot;&quot;, 
            Body: `hi`,  
          }).then(function (message) { 
            document.getElementById(&quot;Div3&quot;).style.display = &quot;none&quot;;
            document.getElementById(&quot;Div5&quot;).scrollIntoView(true);
          }); 
        } 
      &lt;/script&gt; 
  </code></pre>