Struggling with Chloropleth forever

I can get the counties map to appear or the code to appear (in dev tools) but not both. It’s driving me crazy. Every tutorial or article explains it a completely different way.

I suggest pasting the Javascript code in the JS pane.
Also add D3.js library through the Pen Settings.

Thanks for the reply. I tried various combinations like that and it worked even less in CodePen than in real life on my host. Making it work in CodePen isn’t my priority yet – once it works in the real world, I am sure it will work in CodePen. I need the code to work all together as it is in my site which is how it is currently in CodePen. Any thoughts on what’s going wrong with the code itself?

I am not sure what is wrong with the code. Do you have it hosted somewhere else like Github pages? The best thing is to look at the error messages carefully to figure out what is going on. Some online tutorials may not be written well, one misplaced character can cause the whole thing to fail. Or the tutorial could be for a different version than the one you are using.
Good luck.