Forum Discussion

nick_pook's avatar
nick_pook
Community Member
5 months ago
Solved

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 ...
  • SamHill's avatar
    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'));
      });
    });