var userChoice;
$(document).ready(function(){
$("#rock").click(function(){
userChoice = "rock";
});
$("#paper").click(function(){
userChoice = "paper";
});
$("#scissors").click(function(){
userChoice = "scissors";
});
});
document.write(userChoice);
I am trying to get the user output after the click event. But when I run this code I get the output as "undefined". I am very new to programming.
document.writebelongs to a previous millennium, let alone century.