I'm not sure how to word this but is it possible to use the information I've captured and then play it back to the user?
for example.
- User presses
btn1
,btn2
andbtn3
(there is a separate sound that responds to each button click) - Which button and time it was pressed is stored into an empty array (
[{"time":1176,"elemId":"btn1"},{"time":1554,"elemId":"btn2"}]
) - Array is then saved into local storage
- Array is then retrieved from local storage
Now from this point is it possible to playback the information in the array to mimic exactly what the user did?
Apologies if this is too vague but I'm not entirely sure what I'm looking for, thanks in advance!
EDIT: This is all I have so far, I can retreive my array and it shows in my console log but I can't think of how to progress from this point .
function get() {
// Retrieve the object from storage
var value = localStorage.getItem("eventlist");
console.log('value: ', JSON.stringify(value));
}