Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace behaviour.js with jquery #936

Open
hazendaz opened this issue Dec 30, 2016 · 2 comments
Open

Replace behaviour.js with jquery #936

hazendaz opened this issue Dec 30, 2016 · 2 comments

Comments

@hazendaz
Copy link
Member

http://www.bennolan.com/behaviour/

@hazendaz
Copy link
Member Author

Use jquery .live for same behaviour

@pizzi80
Copy link

pizzi80 commented May 13, 2024

I've casually seen this issue

you don't need a js library to attach an event listener
to some elements ... you can use vanilla JS, for example:

const elements = document.querySelectorAll("<selector>");

elements.forEach(function(elem) {
    elem.addEventListener("click", function(event) {
        // ...
    });
});

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants