I'm new to using stack snippets (and JS in general) but the example in my SO question works perfectly on JSFiddle example code, and not on Stack Overflow. I initially thought it was due to the placement of the jQuery library call inside the snippet but I'm not sure that's the case because it seems like intended behavior per this post.
How can I troubleshoot a stack snippet?
This is tagged as a discussion because I believe the problem is an error on my end, not a bug in SO.