DEV Community

Discussion on: [Solved] 2020: Pure Vanilla Javascript Smooth Scroll to Element on anchor tag click #id

Collapse
 
arvindrk profile image
Arvind Ram Singh Kishore

Trigger is the respective DOM Node that is being looped over using the forEach. Also, a onClick handler is being attached to each anchor tag using the same variable 'trigger'