(function() {
var el = document.geElementById('id');
var elSomedata = '13px';
function doSomethingWithEl(el) {
// magic
}
})();
(function() {
var el = document.getElementById('id');
el.someData = '13px';
el.doSomething = function() {
// magic
}
})():
function MyObject ( el ) {
this.el = el;
this.someData = false;
}
MyObject.prototype = {
constructor: MyObject
}
MyObject.prototype.doSmth = function (){}
var MyElement = new MyObject ( document.getElementById('id') )