Thanks for Replying Adam! The timer will be starting and stopping.
First you need some way to select the element. The function given returns the text of a textfield with
the given css-class.
var myText = getText(“.someCssClass”);
The function and approach below dont use any extra libraries and still get the text of any given textfield:
var elem = document.querySelector(_cssClass);// targets a textfield with class someTextfield
var text = elem.textContent; // target the text content
For most objects in Lectora you can get its HTML name by selecting the object going to Properties and then mouse over the little down arrow in the bottom right hand corner in the name box (where you can add a description). However, I find this is not always accurate. I prefer to open the project and use the browsers developers console. From your post, I feel you probably know your way around in there.
The Timer Object is really only for counting up or down and then performing an action when it completes. There is no reserved variable that holds the current timer object time. The timer object code seems to hold a start time number and last update number and from there calculates the time to pop into a span that displays it but its not assigned a variable you can grab. For this reason it is much easier to just grab the current contents of that span (as I did in the example) and do what you need with it from there. I hope I’m making sense. I need coffee…
Or you could use Math’s suggestion if that works better for you.