[Serach] Pagination (next,prev) to limited search results


I’m beginner programmer, it is my first contact with Semantic UI.

I need to create pagination (buttons ‘next’ and ‘prev’) in search results where I have limit visible results to 5.

Limit results, create nav buttons and information about number current page results i create in PHP search function.

I change page number and save query text in search input tag by javascript.
Now i need only know, how to reload search results with new parameters by javascript (reload “result” div).
Can you help me?
Or maybe you know better solution, created by you or other programmer?