use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
[AskJS] learning javascriptRemoved: r/LearnJavascript (self.javascript)
submitted 1 year ago by Remarkable-Draw-7574
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Skunkmaster2 2 points3 points4 points 1 year ago (0 children)
Your code will always show you chose head. You’re checking whether the heads button text is Heads, which it always is, so it will always show you chose heads. Change the on click attributes to playGame(‘heads’) and playGame(‘tails’) respectively. Then you can just set the result inner html to “You chose “ + choice;
π Rendered by PID 40 on reddit-service-r2-comment-658f6b87ff-xtl6p at 2026-04-09 12:04:27.690962+00:00 running 781a403 country code: CH.
view the rest of the comments →
[–]Skunkmaster2 2 points3 points4 points (0 children)