I want to get next 7 sequence of dates on click of right arrow. I'm not sure how to refer my li elements. I tried using this and li.append but none of them worked for me.
$('.rightarrow').on('click', function() {
var y = 1;
var currentDateCGH = new Date();
var date = currentDateCGH.getDate() + 7;
var monthArr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var currMonth = monthArr[currentDateCGH.getMonth()];
var currYear = currentDateCGH.getFullYear();
$(".dateslots li:empty").each(function() {
//$('<li>').append((date + y)+"-"+currMonth);
//$(this).text((date + y)+"-"+currMonth);
y++;
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul class="dateslots">
<li class="leftarrow"> </li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li class="rightarrow"> </li>
</ul>