Is there a good way to attach JavaScript objects to HTML elements?

JavaScript objects can have arbitrary properties assigned to them, there’s nothing special you have to do to allow it. This includes DOM elements; although this behaviour is not part of the DOM standard, it has been the case going back to the very first versions of JavaScript and is totally reliable.

var div= document.getElementById('nav');
div.potato= ['lemons', 3];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)