I have a pagination script, where I need to append classes to the previous and next buttons.
Code for the same as below.
document.querySelector('.prev').style.opacity=(turntopage == 1)? "0.1" : "1";
document.querySelector('.next').style.opacity=(turntopage == totalpages)? "0.1" : "1";
Currently, on click of previous and next, the visibility is being applied from the above which is rendered as below.
<a class="next" href="#next" style="opacity: 0.1;">
<a class="next" href="#next" style="opacity: 1;">
I need to make changes to the above so instead of style, I can append the class which should be rendered as below.
<a class="next disabled" href="#next">
Complete demo can be seen HERE