<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代码
play=document.getElementById("btn-primary");`
play.addEventListener("click", handleAdd, false);
答案 0 :(得分:3)
id是'play',而不是'btn-primary'