change javascript let by html click event

<%- include(“partials/header”) %>

this is main page

<% let cpp= 6 %>
<%  for (let i=0;i<cpp;i++){ %>
    <div class="card">
    <li><%= cards[i].name %></li>
    <li><%= cards[i].price %></li>
    <li><%= cards[i].title %></li>
    <li><%= cards[i].inStore %></li>
    <li><%= cards[i].code %></li>
</div>
    <% } %>

button id=”next”>load more

<%- include("partials/footer") %>

how i can change let cpp=6 to cpp=12 on clicking button id=”next”