<div class="layout">
  <div>
<pre>
scroll-behavior: <select>
      <option value="auto" selected>auto</option>
      <option value="smooth">smooth</option>
    </select>;
</pre>
<a href="#1" class="btn">👉 1</a>
<a href="#2" class="btn">👉 2</a>
  </div>
  <!-- ========= -->
  <div>
    <div class="frame no2">
      <div>
        <div class="element no1" id="1">1</div>
        <div class="element no2" id="2">2</div>
      </div>
    </div>
  </div>
</div>
.element {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.frame > div {
  overflow: auto;
}

.btn {
  display: block;
  width: 50%;
  margin: 0 auto;
  border-radius: 6px;
  border: none;
  padding: 1em;
  font-size: 1em;
  font-weight: 900;
  background: var(--secondary);
  color: var(--primary);
  transition: border-width .3s;
  border: 0 solid var(--secondary);
  text-decoration: none;
  text-align: center;
}
const select = document.querySelector('select');

const no2 = document.querySelector('.frame > div');

select.addEventListener('change', () => no2.style.scrollBehavior = select.value);

External CSS

  1. https://tim-montmorency.com/timdoc/shared/styles/codepen.css

External JavaScript

This Pen doesn't use any external JavaScript resources.