I am working on a project where I have two main divs, one with the id of "left-div" and the other with the id of "right-div". In the "left-div", there are multiple nested divs each with their own unique id. The overflow-y property of the "left-div" is set to scroll. On the other hand, in the "right-div", there are several buttons each with their own id. My goal is to make it so that when a button is clicked, the "left-div" automatically scrolls to display the specific div related to the button. I am using jQuery for this task. How can I achieve this functionality?
Below is the code snippet:
<div id="#left-div">
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
<div id="div4"></div>
</div>
<div id="#right-div">
<button id="btn1"></button>
<button id="btn2"></button>
<button id="btn3"></button>
<button id="btn4"></button>
</div>