$(document).click(function(){
var i = 1;
$("p:nth-child("+i+")").scrollintoview();
i++;
});
<script src="http://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-scrollintoview/1.8/jquery.scrollintoview.js"></script>
<div class="parent">
<div>
<p>Hi</p>
</div>
<div>
<p>Hi</p>
</div>
<div>
<p>Hi</p>
</div>
<div>
<p>Hi</p>
</div>
</div>
I have here this code. I'm trying to make a search feature on every click. How can I search for these paragraphs one by one on every click with this structure of html. Is there any selector that will treat the ".parent" class as the parent element of these paragraphs? Thank you.