Addtions to attrHooks

Addtions to attrHooks

For jQuery 1.6 there will be the ability to set custom 'get' and 'set' hooks for getting and setting custom attributes.

I thought it would be a good idea to have a 'remove' hook in there as well.

My idea behind this is mainly for backwards compatability. For modern browsers you would use the data-* attribute and for older browsers you might use $.data instead ( to overcome memory leaks as an example).

You would need a 'remove' hook for checking which one was used and to take the right action.

So if a browser does support the data-* attribute you could use:

elem.removeAttribute( name )


and

$.removeData( elem, name )

if $.data was used.

Could be handy in propHooks too.