No trouble. The issue’s probably a matter of timing. If you’ve pasted the script inside the
head section of the document without an event listener for when the document is ready, it’ll be executed before the element you’re trying to adapt exists. You could add the script just before the closing
</body> tag instead or use a wrapper like I will add to the example pen (later because it’s apparently being overloaded at the moment). Codepen itself doesn’t really need it because of where it appends the script.
If there’s any more difficulties, just drop a link. ;-)