I added a checkbox in a table in my functions.php, in the following way:
echo '<tr><td><input type="checkbox" name="checkblock"/></td><td> ' . $image . '</td><td>' . $name . '</td><td>' . $qtty . '</td></tr>';
What I need is to be able to save the state of the checkbox on page reload, as this is only needed temporarily while the user is using this page, I don't need anything saving in the database, I have tried following guidance from similar questions in stack overflow and off the internet but it always crashes my site.
I have tried the following in this question: Click Here
Also I have tried following this: Click Here (Although I am not using a form).
I have tried using and following articles and questions off the internet but It either does not work or crashes my site. One difference is others are editing in HTML and JS files whilst I am just using my functions.php and have created the checkbox input option using the line of code above.
Any help would be appreciated.