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

Accept array of selectors #35

Closed
fregante opened this issue Sep 26, 2022 · 2 comments · Fixed by #53
Closed

Accept array of selectors #35

fregante opened this issue Sep 26, 2022 · 2 comments · Fixed by #53
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fregante
Copy link
Owner

See https://github.com/fregante/select-dom/blob/93c48807aa37333a1b89c962f19863f151a3aade/index.ts#L19

const selectors = ['a', 'button'];
delegate(document, selectors, 'click', handler)
@fregante fregante added enhancement New feature or request help wanted Extra attention is needed labels Sep 26, 2022
fregante added a commit to ansg191/refined-github that referenced this issue Nov 14, 2023
Forgot that this isn't here yet fregante/delegate-it#35
@GregOriol
Copy link

@fregante You probably should use multiple selectors in the selector string, separated by comma; would be more standard?

@fregante
Copy link
Owner Author

fregante commented Dec 8, 2023

Yes, but arrays allow you to comment on each selector separately, if necessary. You can still use 'a,button' as always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants