How to add next and prev buttons on filtered results in a dataset

I would like help on how to add next and prev buttons on filtered results in a dataset using the next() and prev().

The next() and prev(). documentation was added it to the code but I need help attaching this to a button

wixData.query("Database")
        .contains("species", $w('#searchInput').value)

let newResults = results;
         newResults.next()
                    
        let items = newResults.items;
    let firstItem = items[0];
        let totalCount = newResults.totalCount;
       let pageSize = newResults.pageSize;
       let currentPage = newResults.currentPage;
    let totalPages = newResults.totalPages;
    let hasNext = newResults.hasNext();
    let hasPrev = newResults.hasPrev();
    let length = newResults.length;
    let query = newResults.query;
       
if (items.length > 0) {


        $w('#listRepeater').data = items;

Buttons have an onClick event that you can use to execute code when they’re clicked: onClick - Velo API Reference - Wix.com