I am trying to create a game in JS and want to have the speed of the ball within able to be changed by a user clicking either a + or - button.
I'm not sure how to do this, here is what I have attempted so far:
var dxoriginal = 6;
var dyoriginal = -6;
document.getElementById("speed").innerHTML = dxoriginal;* { padding: 0; margin: 0; }
     canvas { background: #eee; display: block; margin: 0 auto; }
  .button5 {
    background-color: white;
    color: black;
    border: 2px solid #555555;
    width: 20px;
    float: left;
    }
   .button5:hover {
    background-color: #555555;
    color: white;
  }<div style="float:left; margin-left:10px;" id="speed">Speed</div>
<br />
<button class="button button5" value="undefined">-</button>
<button class="button button5" value="undefined">+</button>This does display the current speed the game is set to, yet I have no idea how to change it based on the buttons I have created.
Thanks in advance for your help
 
     
     
     
     
    