Integrating Javascript

Hi There!

I’m developing an admin layout that features, “Back to Top” buttons throughout the length of the form. I’m trying to understand how to integrate Javascript into the buttons. It seems I can add a class to the buttons, and include JS, however, it seems like there may be a better way to lean on Agile to do most of this work. Is there a recommended method for integrating this type of functionality with Agile, or some best practice?

Clicking the button would smooth scroll the visitor to the top of the page. (I could also use the CSS smooth-scroll property)

Thanks!

Hello,

Did you try $button->js('click', <js expression>);?

Thanks! I’m in the “learning curve” stage, and this helped point me in the right direction!