why can't this code work for other platforms such as on codepen?
Can you post the HTML code?
It's probably to do with the link to the main.js code. Change "main.js" in your script tag to whatever the URL to your JS on Codepen is.
Yes, I got it! However, is it possible to code this from scratch without linking it to original website in HTML?
You mean without linking it to Codecademy's 'bubbles.js' script? Sure, it's certainly possible. But I wouldn't recommend it because it requires a lot of code. If you want to see the JS code that Codecademy made for you, just copy the URL into the address bar at the top of your browser and hit enter - It will come up with some text which will be the code... there's a lot.
Also, jQuery is used, so if you wanted to do this without it, it would require much more code, so overall I don't recommend doing it the long way, just keep to what you have and brag about your supreme coding skills
If you are working somewhere that doesn't allow multiple JS files, you can copy everything from bubbles.js (and alphabet.js) into your JS panel there. Then you can edit it all you want. There are some suggestions for that over here:
Also, jQuery is used, so if you wanted to do this without it, it would require much more code.
Not really. You would have to type only few extra characters. Sometimes it is a good idea to check the code before writing a comment about it This project is a great example of a bad usage of jQuery.