Forum Discussion
Java script for multiple copy buttons not working
JS is notoriously finicky, so it is tough to tell without seeing the project. The tiniest thing missed in copying can throw it off. It is also notorious for distinguishing between straight and curly quotation marks, so you might check that.
Attach your .story file here, and someone can help; there are a lot of strong programmers that frequent this forum.
I do have one suggestion. It seems to me that you want a customized message to appear on different layers or slides when certain conditions are met. I can two ways of doing that that seem easier to me than using JS. (It should be noted that for me, JS is an absolute very last resort, because the next person that has to maintain the project may not have a programming background.)
If you place a text area on a slide, and put nothing in it except a text variable reference, nothing will show as long as the variable is blank. So instead of your trigger executing JS, it can change the variable, and it will suddenly appear. (Setting it back to blank will make it disappear.)
If you want more in the message than just plain text, you might consider a lightbox slide. Again, using a text variable reference will allow the message to change to match the conditions. It will also allow you to put other things (like the Yes No buttons to answer the question) on it. Using a lightbox also frees you from designing around where the text area might show up, and you have only one design.