I have this HTML that has the id that is inserted into the loop repeat ...
%pre%
So I have this function:
%pre%
In this '.element' I actually wanted to do something like %code% of the element I clicked on, remembering that this function is out of loop repetition ... is there any way to do this?
______ azszpr344407 ___
An alternative way could be:
%pre%
Where soon after, in your JavaScript file, your function should be written
%pre%
Providing %code% as a parameter allows you to retrieve the properties of the field as: %code%
______ azszpr344408 ___
In cases where you have multiple elements with the same class, but want to get the ID of the element that triggered the event, you should use %code% (pure JavaScript) or %code% (jQuery), in the example below I just changed the 'touchstart' event for the 'click':
______ azszpr344418 ___
To interact with the event-enabled element, you can only
%pre%
%code% will always reference the element that triggered the event.
___