Save classes added with .addClass() with HTML 5 storage or cookies?

Save classes added with .addClass() with HTML 5 storage or cookies?

For a school project I need to make a booking system for a cinema, so people can select seats where they want to sit.

One requirement is that if someone booked a chair, someone ele shouldn't be able to book it anymore.

My idea was to add a class to the selected chairs when you click "Buy tickets" on the bottom of the page, but how can I save these classes, my professors say I should use HTML 5 storage, but they refuse to help me any further.

This is a part of what I already have now:

  1. <script>
  2. var total = 0;
  3. var countBlauw = 0;
  4. var countOranje = 0;
  5. var countRood = 0;
  6. $(document).ready(function(){
  7.     $(".blauw").toggle(function () {
  8.       $(this).removeClass("blauw").addClass("select");
  9. countBlauw++;
  10. total+=7.5;
  11. calculateTotal();
  12. }, function() { 
  13.       $(this).removeClass("select").addClass("blauw");
  14. countBlauw--;
  15.       total-=7.5;
  16. calculateTotal();
  17.     });
  18. $(".oranje").toggle(function () {
  19.       $(this).removeClass("oranje").addClass("select");
  20. countOranje++;
  21. total+=10;
  22. calculateTotal();
  23. }, function() {
  24.       $(this).removeClass("select").addClass("oranje");
  25. countOranje--;
  26.       total-=10;
  27. calculateTotal();
  28.     });
  29. $(".rood").toggle(function () {
  30.       $(this).removeClass("rood").addClass("select");
  31. countRood++;
  32.       total+=15;
  33. calculateTotal();
  34. }, function() {
  35.       $(this).removeClass("select").addClass("rood");
  36. countRood--;
  37.       total-=15;
  38. calculateTotal();
  39.     });
  40. });
  41. </script> 
  42.         <script>
  43.         function calculateTotal()
  44.         {
  45.             var divobj = document.getElementById('totalPrice');
  46.             divobj.style.display='block';
  47.             divobj.innerHTML = "Prijs €"+total+"<br /> Aantal blauwe stoelen: "+countBlauw+"<br /> Aantal oranje stoelen: "+countOranje+"<br /> Aantal rode stoelen: "+countRood;
  48.         
  49.         }
  50.         </script> 
  51.         
  52.         <table style="empty-cells: hide; border-collapse:separate; border-spacing:2px; border-style:solid;" border="0">
  53.           <tr>
  54.             <td class="leeg"></td>
  55.             <td class="leeg"></td>
  56.             <td class="blauw">&nbsp;</td>
  57.             <td class="blauw">&nbsp;</td>
  58.             <td class="blauw">&nbsp;</td>
  59.             <td class="blauw">&nbsp;</td>
  60.             <td class="blauw">&nbsp;</td>
  61.             <td class="blauw">&nbsp;</td>
  62.             <td class="blauw">&nbsp;</td>
  63.             <td class="blauw">&nbsp;</td>
  64.             <td class="leeg"></td>
  65.             <td class="leeg"></td>
  66.           </tr>
  67.             And so forth.

  68.         <script>
  69. $(window).load( function() {
  70. document.getElementById('totalPrice').innerHTML = "Prijs €"+total+"<br /> Aantal blauwe stoelen: "+countBlauw+"<br /> Aantal oranje stoelen: "+countOranje+"<br /> Aantal rode stoelen: "+countRood;
  71. });
  72. </script>
  73.         <div id="totalPrice"></div>
But this isn't the only problem....

Because there are 3 cinema halls, different dates and different movies....

I'd like to combine it all in one page, but I guess that'd be extremely difficult to make.

Could someone please give me some advice?