Can I use the same jQuery on Handler for two different objects with different IDs?

Bronze Contributor
Bronze Contributor
Does the jQuery selector allow regex or something to fire the same analytics call for two different objects? I require the exact same call to fire on click of two different tags with different IDs. Can I do that with the same on Handler or do I need two different on Handlers?
1 REPLY 1

Can I use the same jQuery on Handler for two different objects with different IDs?

Tealium Employee
Hi Yasho, You can use the same jQuery handler, you just need to separate the selectors with a comma. A great reference is https://api.jquery.com.
Public