Sophie Hudson Hamm
Sophie Hudson Hamm

Reputation: 1

Button won't link to Javascript

<div class ="form-group">
    <div class ="form-group">
         <div class="col-xs-8 col-xs-offset-4">
             <input type = "button" value="Play Game" class="btn btn-primary" id="play">
         </div>
    </div>

JavaScript Code

play=document.getElementById("btn-primary");`
play.addEventListener("click", handleAdd, false);

Upvotes: 0

Views: 32

Answers (1)

Kevin Seifert
Kevin Seifert

Reputation: 3572

The id is 'play', not 'btn-primary'

Upvotes: 3

Related Questions