the code is executed multiple times by bubble (e.g. when the dynamic data you use changes) so your code needs to be ready for that. this is a pattern that can be useful.

on a side note including user-generated dynamic data in a string that is then evaluated as javascript (it’s what is done with scripts in html elements) is a security risk.

1 Like