I want to implement logic where after clicking into the button the counter will be incremented by 5 (5, 10, 15, 20...) and this, so to speak, state, would be used inside the for loop as a second argument (ie. how many loops should it proceed).
<body>
<% var counter %>
<% for (var i = 0; i < counter; i++) { %>
...some items to be rendered in number of 5, 10, 15 and so on...
<% } %>
<button onclick="<%() => counter = counter + 5%>">Load more</button>
</body>
Above does not work. How can I achieve that kind of state in EJS? Thanks!