Forum Discussion
Borg_Cube
8 months agoCommunity Member
Working with Javascript triggers - how to find button ID's and Classes (States)?
Hi,
I have a JS-script which should change the state of a button when a user enters a certain code into a text-entry field.
However, I'm unable to find the ID and classes of the button anywhere....
Borg_Cube
8 months agoCommunity Member
Hi Brian, and thanks for your reply.
Yes, that is a good tip. However JS triggers can be very powerful and leverage the need to implement a lot of workarounds and hassle with "regular" triggers.
I find it a little peculiar that Articulate allows us to execute code to manipulate objects and elements, yet do not provide us the information to find the object-ID's and classes, for example for different states.
Let's say I want to run the following to solve my issue:var textEntry = player.GetVar("TextEntry");
var button = player.GetPlayer().GetElementById("ButtonElementID");
if (textEntry === "some-string")
{ button.className = "desired-state-class";
I can't because I cannot find the object-information I need.