How to scroll the focus of a particular div with the same class name or attribute

advertisements

how to scroll focus a particular div having same class name or same attribute, when click on li have class name list1 then the scroll need to focus on div class list1

<ul>
<li class="list1">list1</li>
<li class="list2">list1</li>
<li class="list3">list1</li>
</ul>
<div class="list1"></div>
<div class="list2"></div>
<div class="list3"></div>


Hi You can try this solution.

<ul>
<li class="list1"><a href="#list1">list1</a></li>
<li class="list2"><a href="#list2">list2</a></li>
<li class="list3"><a href="#list3">list3</a></li>
</ul>
<div id="list1">list1</div>
<div id="list2">list2</div>
<div id="list3">list3</div>