Hi guys,
I change my code from Javascript to jQuery and I believe I have everything allright, but my jQuery is not showing the value. Can you help me with it? I am adding the important snippets but if you need all my code here is it Click Here.
Thank you.
My original Javascript
function guessesUsed(attemptsTaken) {
var numGuessesLeft = document.getElementById("userAttempts");
numGuessesLeft.innerHTML = attemptsTaken;
}
HTML (Older version)<div>You have guessed: <span id="userAttempts"></span> times</div>
jQuery version
function guessesUsed(attemptsTaken) {
var numGuessesLeft = $('#userAttempts').val();
numGuessesLeft.innerHTML = attemptsTaken;
} //End of function guessesUsed(attemptsTaken)
HTML New Version<p id="guessesUsed">You have guessed: <span id="userAttempts"></span> times out six(6) chances.</p>
CSS for the jQuery version
.guessesLeft {
font-weight:bold;
color:#C00;
}