title: html/css interactive calendar next/prev day button coding
body: <p>I am using a tutorial I found online to fit my needs for a project.  I would like to add in functional buttons that select between days (changing "active" days in calendar) and select between months. </p>
  
  <p>My first question is how do I code the prev day and next day buttons to change the previous and next day to active according to css?  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
  
    &lt;style&gt;
      * {
        box-sizing: border-box;
      }
      ul {
        list-style-type: none;
      }
      body {
        font-family: Verdana, sans-serif;
      }
      .month {
        padding: 70px 25px;
        width: 100%;
        background: #1abc9c;
      }
      .month ul {
        margin: 0;
        padding: 0;
      }
      .month ul li {
        color: white;
        font-size: 40px;
        text-transform: uppercase;
        letter-spacing: 3px;
      }
      .month .prev {
        float: left;
        padding-top: 10px;
      }
      .month .prevDay {
        float: left;
      }
      .month .next {
        float: right;
        padding-top: 10px;
      }
      .month .nextDay {
        float: right;
      }
      .weekdays {
        margin: 0;
        padding: 10px 0;
        background-color: #ddd;
      }
      .weekdays li {
        display: inline-block;
        width: 13.6%;
        color: #666;
        text-align: center;
      }
      .days {
        padding: 10px 0;
        background: #eee;
        margin: 0;
      }
      .days li {
        list-style-type: none;
        display: inline-block;
        width: 13.6%;
        text-align: center;
        margin-bottom: 5px;
        font-size: 12px;
        color: #777;
      }
      .days li .active {
        padding: 5px;
        background: #1abc9c;
        color: white !important
      }
      /* Add media queries for smaller screens */
      @media screen and (max-width: 720px) {
        .weekdays li,
        .days li {
          width: 13.1%;
        }
      }
      @media screen and (max-width: 420px) {
        .weekdays li,
        .days li {
          width: 12.5%;
        }
        .days li .active {
          padding: 2px;
        }
      }
      @media screen and (max-width: 290px) {
        .weekdays li,
        .days li {
          width: 12.2%;
        }
      }
    &lt;/style&gt;
  
    &lt;style&gt;
      .pM_button {
        padding: 15px 25px;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
        outline: none;
        color: #cc9900;
        background-color: #ffff00;
        border: none;
        border-radius: 15px;
        box-shadow: 0 9px #999;
      }
      .pM_button:hover {
        background-color: #ffff00
      }
      .pM_button:active {
        background-color: #ffcc00;
        box-shadow: 0 5px #666;
        transform: translateY(4px);
      }
      .nM_button {
        padding: 15px 25px;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
        outline: none;
        color: #ffffff;
        background-color: #9900cc;
        border: none;
        border-radius: 15px;
        box-shadow: 0 9px #999;
      }
      .nM_button:hover {
        background-color: #9900cc
      }
      .nM_button:active {
        background-color: #660066;
        box-shadow: 0 5px #666;
        transform: translateY(4px);
      }
      .nD_button {
        padding: 15px 25px;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
        outline: none;
        color: #ffffff;
        background-color: #ff0000;
        border: none;
        border-radius: 15px;
        box-shadow: 0 9px #999;
      }
      .nD_button:hover {
        background-color: #ff0000
      }
      .nD_button:active {
        background-color: #800000;
        box-shadow: 0 5px #666;
        transform: translateY(4px);
      }
      .pD_button {
        padding: 15px 25px;
        font-size: 24px;
        text-align: center;
        cursor: pointer;
        outline: none;
        color: #ffffff;
        background-color: #33cc33;
        border: none;
        border-radius: 15px;
        box-shadow: 0 9px #999;
      }
      .pD_button:hover {
        background-color: #33cc33
      }
      .pD_button:active {
        background-color: #009900;
        box-shadow: 0 5px #666;
        transform: translateY(4px);
      }
    &lt;/style&gt;
  
  &lt;/head&gt;
  
  &lt;body onkeydown="GetKey()"&gt;
  
    &lt;div class=" month "&gt;
      &lt;ul&gt;
        &lt;li class="prev "&gt;
          &lt;button class="pM_button "&gt;Prev Month&lt;/button&gt;
        &lt;/li&gt;
        &lt;li class="prevDay "&gt;
          &lt;button class="pD_button "&gt;Prev Day&lt;/button&gt;
        &lt;/li&gt;
        &lt;li class="next "&gt;
          &lt;button class="nM_button "&gt;Next Month&lt;/button&gt;
        &lt;/li&gt;"
        &lt;li class="nextDay "&gt;
          &lt;button class="nD_button "&gt;Next Day&lt;/button&gt;
        &lt;/li&gt;
        &lt;li style="text-align:center "&gt;
          August
          &lt;br&gt;
          &lt;span style="font-size:18px "&gt;2016&lt;/span&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  
    &lt;ul class="weekdays "&gt;
      &lt;li&gt;Mo&lt;/li&gt;
      &lt;li&gt;Tu&lt;/li&gt;
      &lt;li&gt;We&lt;/li&gt;
      &lt;li&gt;Th&lt;/li&gt;
      &lt;li&gt;Fr&lt;/li&gt;
      &lt;li&gt;Sa&lt;/li&gt;
      &lt;li&gt;Su&lt;/li&gt;
    &lt;/ul&gt;
  
    &lt;ul class="days "&gt;
      &lt;li&gt;&lt;span class="active "&gt;1&lt;/span&gt;
      &lt;/li&gt;
      &lt;li&gt;2&lt;/li&gt;
      &lt;li&gt;3&lt;/li&gt;
      &lt;li&gt;4&lt;/li&gt;
      &lt;li&gt;5&lt;/li&gt;
      &lt;li&gt;6&lt;/li&gt;
      &lt;li&gt;7&lt;/li&gt;
      &lt;li&gt;8&lt;/li&gt;
      &lt;li&gt;9&lt;/li&gt;
      &lt;li&gt;10&lt;/li&gt;
      &lt;li&gt;11&lt;/li&gt;
      &lt;li&gt;12&lt;/li&gt;
      &lt;li&gt;13&lt;/li&gt;
      &lt;li&gt;14&lt;/li&gt;
      &lt;li&gt;15&lt;/li&gt;
      &lt;li&gt;16&lt;/li&gt;
      &lt;li&gt;17&lt;/li&gt;
      &lt;li&gt;18&lt;/li&gt;
      &lt;li&gt;19&lt;/li&gt;
      &lt;li&gt;20&lt;/li&gt;
      &lt;li&gt;21&lt;/li&gt;
      &lt;li&gt;22&lt;/li&gt;
      &lt;li&gt;23&lt;/li&gt;
      &lt;li&gt;24&lt;/li&gt;
      &lt;li&gt;25&lt;/li&gt;
      &lt;li&gt;26&lt;/li&gt;
      &lt;li&gt;27&lt;/li&gt;
      &lt;li&gt;28&lt;/li&gt;
      &lt;li&gt;29&lt;/li&gt;
      &lt;li&gt;30&lt;/li&gt;
      &lt;li&gt;31&lt;/li&gt;
    &lt;/ul&gt;
  
    &lt;script type="text/javascript "&gt;
      function GetKey(e) {
        var code;
        if (!e) var e = window.event;
        if (e.keyCode) code = e.keyCode;
        else if (e.which) code = e.which;
        //var character = String.fromCharCode(code);
        setTimeout('ShowTree(' + code + ');', 100);
      }
  
      function nextDay() {
  
      }
  
      function ShowTree(character, k) {
  
  
        //Main Menu Key
        if (character == 106) {
          cWindow.close();
        }
  
        //Close Key
        if (character == 111) {
          alert(" Key: / ");
          responsiveVoice.speak("Close ", "UK English Male ");
        }
  
        //PageUP Key, next month
        if (character == 98) {
          alert(" Key: 2 ");
          responsiveVoice.speak("Page Up ", "UK English Male ");
        }
        //PageDOWN key, previous month
        if (character == 99) {
          alert(" Key: 3 ");
          responsiveVoice.speak("Page Down ", "UK English Male ");
        }
  
        //Previous Key, Previous Day
        if (character == 65) { //keypad key 101
          responsiveVoice.speak("Previous ", "UK English Male ");
  
          //alert(" Key: 5 ");
        }
  
        //Next Key, Next Day
        if (character == 68) { //keypad key 102
          responsiveVoice.speak("Next ", "UK English Male ");
          $(".pD_button ").click(.days.active++);
          //alert(" Key: 6 ");
        }
  
        //Select Key
        if (character == 83) { //keypad key 104
          responsiveVoice.speak("Select ", "UK English Male ");
  
        }
  
        //alert(" Key: 8 ");
      }
    &lt;/script&gt;
  
  
  
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>