How to add anchor links to a Builder page

As a note, if you are not rendering HTML on your server and instead are only rendering the page on the client (JavaScript only), anchor links might not behave as expected. When the browser looks at the html (before JavaScript loads), if it does not find an element with the id you set it will not be able to scroll to anything, since that element does not exist. Once the javascript loads and builds the html, the browser does not re-evaluate the url to scroll the element with the id into view. One way to get around this is to add some javascript that runs once the builder content has been built. You can place this in the custom JavaScript section in the Builder editor. For example:

setTimeout(() => {
  const element = document.getElementById(window.location.hash.replace('#', ''));
  if (element) {
    element.scrollIntoView();
  }
});