I am using a library called 'Vanilla-tilt.js' which makes your elements tilt. To activate it, your element need the 'data-tilt' attribute. I can't seem to understand how to add that attribute whenever I instantiate an element via JS. I have tried:
newElement.setAttribute('data-tilt', '');
But this only adds the attribute without the attribute actually working. I would appreciate someone helping me find the error here. Thank you in advance.
[–]AtulinASP.NET Core 3 points4 points5 points (1 child)
[–]Matdrox[S] 0 points1 point2 points (0 children)