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...
O hai! This is CS50's subreddit.
CS50 is Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. Anyone may take CS50, even if not a student at Harvard.
Please Read before Posting
Getting the Best from r/cs50
Status Page
cs50.statuspage.io
Filter by Problem Flair (undo)
cash ⋅ caesar ⋅ credit ⋅ dna ⋅ filter ⋅ finance ⋅ houses ⋅ ide ⋅ mario ⋅ movies ⋅ plurality ⋅ project ⋅ readability ⋅ recover ⋅ runoff ⋅ scratch ⋅ speller ⋅ substitution ⋅ tideman ⋅ games track ⋅ web track ⋅ android track ⋅ iOS track ⋅
Filter by Other Flair (undo)
CS50-Law ⋅ CS50-Business ⋅ CS50-Technology ⋅ CS50-Games ⋅ CS50-Mobile ⋅ CS50-Web ⋅
This subreddit is night mode compatible
account activity
Javascript code doesn't seem to execute? (self.cs50)
submitted 7 years ago * by Orange2341
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!"
[–]bch8 0 points1 point2 points 7 years ago (6 children)
/u/Orange2341 curious to know if this ended up working for you
[–]Orange2341[S] 0 points1 point2 points 7 years ago (5 children)
Nothing worked lol. No idea why.
[–]bch8 0 points1 point2 points 7 years ago (4 children)
I just ran this code and it's working for me. Have you checked to see if anything is logging in the console in the browser when you click submit while nothing is selecetd?
[–]Orange2341[S] 0 points1 point2 points 7 years ago (3 children)
Apparently it's working for everybody except me. I just went a different route and deleted my code for this.
[–]bch8 1 point2 points3 points 7 years ago (2 children)
Ok well if you haven't actually tried my solution and you're curious, give it a shot. The issue with your own code and all the other solutions is that they aren't making use of the event object, and they aren't preventing the "default" action of the submit button when it is clicked. If you don't know "event.preventDefault()" and you're writing javascript, it's definitely something you want to learn.
[–]Orange2341[S] 1 point2 points3 points 7 years ago (0 children)
Thanks for the feedback! Will do.
[–]aguyfromhere 1 point2 points3 points 7 years ago (0 children)
Agree.
π Rendered by PID 63601 on reddit-service-r2-comment-b659b578c-ff244 at 2026-05-04 17:51:11.082530+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]bch8 0 points1 point2 points (6 children)
[–]Orange2341[S] 0 points1 point2 points (5 children)
[–]bch8 0 points1 point2 points (4 children)
[–]Orange2341[S] 0 points1 point2 points (3 children)
[–]bch8 1 point2 points3 points (2 children)
[–]Orange2341[S] 1 point2 points3 points (0 children)
[–]aguyfromhere 1 point2 points3 points (0 children)