When i click on Reject Button
I am calling/ triggering next button click event .
Is it possible to know from the in the next event function if the request has come by calling reject ??
This is my jsfiddle http://jsfiddle.net/6xskkzjh/9/
This is my code
<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">
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 (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();
});