Skip to content

Observe attribute changes #4521

Answered by ekwoka
lonix1 asked this question in 1. Help
Feb 7, 2025 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

With alpine, you'd still use a mutation observer.

Alpine has some helpful methods that might help, I think it's Alpine.onAttributeAdded, but probably easily to slap a mutation observer inside an init. Just observe the same element and toggle the thing.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lonix1
Comment options

@ekwoka
Comment options

Answer selected by lonix1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants