jQuery is adding a strange attribute to nodes

jQuery uses these “expando” properties to keep track of data associated with elements. jQuery uses its data API for event handling plus any general data that you may want bound to an element (using $.data).

The property (jQuery1279875396122) will have a value associated with a position in jQuery.cache.

The reason jQuery doesn’t save data directly to the element (as regular properties) is to avoid memory leaks and just to generally be a little less obtrusive.


Just as an example, when you bind an event handler to an element, like so:

jQuery('div').click(doSomething);

The doSomething function will be stored in jQuery.cache and, on a rudimentary level, its position (or rather, the position of the object that references it) will be assigned to the element’s jQuery1279875396122 property. jQuery will still use the browser’s native API to bind to the element’s event but when it’s fired jQuery will lookup (in jQuery.cache) and call the correct handlers.

EDIT: Just to be clear, these properties are not a cause for concern. You should expect to see them on all elements that have any data bound via jQuery (including event handlers). I would be very surprised if this was the cause of your rendering problem.

Leave a Comment