Observe attributes for #637 #641

wants to merge 9 commits into


None yet
1 participant

justinbmeyer commented Jan 4, 2014

Pertaining to #637, this pull request lets you listen to when HTML attributes change. For example:

var div = $("<div>")

div.bind("attributes", function(ev){
  ev.attributeName //-> "foo"
  ev.oldValue //-> null
  ev.type //-> "attributes"


It integrates directly with jQuery and Zepto's attr,and removeAttr, Mootool's set, and Dojo's dojo.setAttr and dojo.removeAttr.

It's tested against live-binding so that changes to attrValue in the following will fire attributes events:

<div foo="{{attrValue}"/>

Attributes with jQuery works via MutationObserver in browsers that support it. No other library uses MutationObservers. All browsers should work, but I have not tested IE.


This comment has been minimized.

Show comment
Hide comment

justinbmeyer Jan 22, 2014


merged this into minor myself ...


justinbmeyer commented Jan 22, 2014

merged this into minor myself ...

@justinbmeyer justinbmeyer deleted the observe-attributes branch May 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment