Forum Discussion
nick_pook
5 months agoCommunity Member
Get object ID of the object that was part of the trigger
Hello All- I am guessing this is going to need to be a feature request since I couldn't find anything about it but figured I wad ask here first before submitting one just in case.
I am looking for ...
- 4 months ago
Hi nick_pook I'm not sure of the context of your usage, but could you use any regular smegular JS to get the object ID through the data-model-id property of the element?
document.querySelectorAll('[data-model-id]').forEach(el => { el.addEventListener('click', () => { console.log(el.getAttribute('data-model-id')); }); });
SamHill
4 months agoSuper Hero
Hi nick_pook I'm not sure of the context of your usage, but could you use any regular smegular JS to get the object ID through the data-model-id property of the element?
document.querySelectorAll('[data-model-id]').forEach(el => {
el.addEventListener('click', () => {
console.log(el.getAttribute('data-model-id'));
});
});
- nick_pook4 months agoCommunity Member
This did work for my use case. It does feel like a workaround for something that should be pretty easy since Storyline already knows what was interacted with.
Thank you for your help!
Related Content
- 11 months ago
- 3 months ago
- 10 months ago