I'm doing the scoreboard website, so the CSS and HTML is already finished but I stuck with how to count up the score one by one. I use php to change the class name in div and the number will be change. Now I need to change value in the variables in php to change the number. I want to know how to write command to count up the value in php by onclick function, one by one. Thanks for your help.
This is script and php.
function myFunction(){
<?php
$s = 1;
$d = "display-no-$s";
?> }
and this is HTML
<button onclick="myFunction()">Click Me</button>
<div id="clock-container">
<div id="display-1" class="display-container display-size-12 <?php echo $d; ?>">
<div class="segment-x segment-a"><span class="segment-border"></span></div>
<div class="segment-y segment-b"><span class="segment-border"></span></div>
<div class="segment-y segment-c"><span class="segment-border"></span></div>
<div class="segment-x segment-d"><span class="segment-border"></span></div>
<div class="segment-y segment-e"><span class="segment-border"></span></div>
<div class="segment-y segment-f"><span class="segment-border"></span></div>
<div class="segment-x segment-g"><span class="segment-border"></span></div>
</div>
</div>