Get name of element with JavaScript
Hi,
I´ve got the following problem:
I create a Captivate slide with an object called "triangle". This object is manipulated with JavaScript code (for example hidden, shown, ...).
However, if I copy the slide into another project where an object with the name "triangle" already exits, the object will be renamed by Captivate - for example into "triangle_127". This happens all the time, because the slide is a template slide for a larger project and is used several times within that project.
This causes the problem that the JavaScript code (for example \cp.show("triangle"); ) won't work anymore as the element is now called "triangle_127". Of course I could just adapt the JavaScript code and rename all objects in the code "by hand". However, this would be too inconvenient and time consuming because it's a huge project with long JavaScript codes.
So my question to all JavaScript professionals: How would you handle this problem? Which solutions do you suggest?
I use Captivate 9 (most recent version) and publish in HTML5. Any help is highly appreciated. Thank you very much in advance!

