I make a function in javascript and I want when the user clicks on the next button it changes the div from previous values and contain new values here is my code:
<div id="new34" style=" width:1028px; height:15px; background#fff; float:left;">
<div id="previous" style="float:left; width:20px;">
<a href="javascript:void(0)">
</a>
</div>
<div id="next" style="float:left; width:20px;">
<a href="javascript:void(0)" onClick="getBusinesses(2)">></a>
</div>
</div>
and here is my javascript function:
function getBusinesses(page) {
$.ajax({
type: "POST",
url: "getbusiness.php",
data: "page=" + page,
success: function (msg) {
$("#new2").ajaxComplete(function (event, request, settings) {
$("#new2").html(msg);
});
}
});
}
I want when user click on id=next then increment the value and change
<div id="new34" style=" width:1028px; height:15px; background#fff; float:left;">
<div id="previous" style="float:left; width:20px;">
<a href="javascript:void(0)" onClick="getBusinesses(1)">
<</a>
</div>
<div id="next" style="float:left; width:20px;">
<a href="javascript:void(0)" onClick="getBusinesses(3)">></a>
</div>
</div>
and so on