window.scrollTo(0, 300); This is for scrolling the window, but scrolling the li label below,
For example, scrolling li[9] to the top, what should be done?
<p id="example-2">
<p>这是标题</p>
<p id="p1" style="height: 5rem;border: 1px solid #007AFF;overflow: scroll;">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
</ul>
</p>
</p>
Code address