title: Scroll to anchor with offset after form submit
body: <p>I have a form that I want to scroll up to the thank you message after submit. I've been given a code to have my page scroll up after form submit and the script kind of work but since I have a big text before the form, it scrolls pass the thank you message, to the top of the page with the 150px offset fore the sticky header. The reason I'm asking here is that I'm not very talented with scripts, and the person who handed me the script is unreachable right now... time sensitive case.</p>
  <p>Here is the code I have :</p>
  <pre><code>var form = document.querySelector(&quot;#cf_7&quot;);
  form.addEventListener(&quot;afterSubmit&quot;, function(event) {
       setTimeout(function() { window.scrollTo({ top: 150, left: 0, behavior: 'smooth' }); }, 100);
  });
  </code></pre>
  <p>So if I set an anchor like #succes at the top of the thank you message, and I would want the script to scroll to that anchor (with the 150px offset), how would my script look like if I wanted to keep the present structure?</p>
  <p>Thanks in advance for your precious help and I hope I was clear enough.</p>