Trying to make a blackjack game my first button works fine but trying to pass the hit and stand isn't working just says not defined.
I'm trying to pass the onclick playerMove("stand") and playerMove("Hit") to the playerMove(a) function at the bottom but wont work.
<body>
<div> <!--Betting function and buttons for the game-->
<div><h1> BlackJack. Beat The Dealer</h1></div>
<div class ="cash">Total £<span id="pounds">1000</span></div>
<div>Stake £<input type="number" id="mystake" value="0" min="1">
<div id ="msg"></div>
<div id="start">
<button id ="startbtn" type="button" onclick="Start()" class = "btn">Start Game</button>
</div>
<div id ="result">
Dealers Hand : <span id="dealValue"></span>
<div id ="dealerHold"></div> <!--placements for dealer hand-->
Players Hand : <span id="playerValue"></span>
<div id = "playerHold"></div> <!--placements for player hand-->
<div id="playerMoves">
<button id="btnstand" type="button" onclick='playerMove("stand")' class="btn">Stand</button> <!-- buttons for the main blackjack functions -->
<button id="btnhit" type="button" onclick='playerMove("hit")' class="btn">Hit</button>
</div>
<div>
<button id="btndeal" type="button" onclick="newDeal()" class="btn">Deal</button>
</div> <!-- once cards are dealt this button will dissapear -->
</div>
function playerMove(a){
console.log(a);
switch(a){
case 'hit':
playaCard(); // if hit is passed through then we run playacard function
break;
case 'stand': //if stand is passed through we end the players game through function
playend();
break;
}
}