The reason your code didn’t work, is because there is no #passage-cs1-p1 when your javascript runs.
The contents of the Story Javascript runs as soon as your game is loaded, before any of the passages exist. Even if it ran slightly later, there would still not be a #passage-cs1-p1 unless that’s the very first passage of your game, because passages don’t exist as elements in that way unless they are the current passage.
If you need to run Javascript when some particular passage loads, you can either put it in the passage directly inside a <<script>> macro, or (better practice) use an event listener to listen for the passage load events and do something there.
There is a “PassageFooter” you can add (a specially named passage) that will get added to the bottom of every page. You might want to do it that way.