Thanks for the invitation, @crazy4x’s method is also OK. data-* In general application scenarios, the MV* framework is not used, and event proxying is used to avoid the need to manually add/remove listeners when list data changes. By adding a listener to the parent, then getting the event object, and then getting the custom attribute value of the current item in the list, the following example provides another way, for reference only.
The data of your attributes is originally recycled, just get the data directly. Never think about jq’s method
Thanks for the invitation, @crazy4x’s method is also OK.
data-*
In general application scenarios, the MV* framework is not used, and event proxying is used to avoid the need to manually add/remove listeners when list data changes. By adding a listener to the parent, then getting the event object, and then getting the custom attribute value of the current item in the list, the following example provides another way, for reference only.