Actually true, I also went and tried online courses from coursera and udemy but I always end up looking up codes from w3school. However they only show pretty basic examples so it's up to you to play around a specific code. When on the job, if I need to look up some codes, i'd go to w3school. Like decodx said it's well organized so you can easily look for whatever you're finding.
As I said too, if you want to make anything on your own then it is important to take the mastery course which is also available on online as well but the time period maybe longer than those beginners course but it is mandatary to learn it completely then you can develop things as you wanted with your creativit nature.