JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="next" value="Next">
      
   <input type="button" id="prev" value="Prev">

 <div id="countdiv">
     <Span>Showing  </Span> Of <span>Items</span>
</div>

        <input type="button" value="Reject One Item" id ="reject">

JavaScript

var totalcount = 10;
var current_count = 0;



$(document).on('click', '#prev', function (event) {
    if(current_count>1)
    {
    current_count--;
    updateDiv();
    }
});

$(document).on('click', '#next', function (event) {
if(event.originalEvent=== undefined){
   alert('triggered....not clicked');
}
if (current_count < totalcount) {
    current_count++;
    updateDiv();
}
});

function updateDiv() {
    $('#countdiv').html('Showing '+current_count+' of'+totalcount+' items');
    
}


$(document).on('click', '#reject', function (event) {
 totalcount--;
    $( "#next" ).click();    
    
});