I suppose this is what you're looking after:
var elem = document.getElementById('some_element'),
CustomColor = function (element) {
this.htmlElement = element;
};
CustomColor.prototype.changeColor = function (color) {
this.htmlElement.style.color = color;
return;
};
elem.customColor = new CustomColor(elem);
Using attached property:
elem.customColor.changeColor('#00f');
Only way to get a reference to the hosting HTML element is to pass it as an argument to the constructor. However, in changeColor you can't refer any "private" variable of CustomColor (including its arguments), hence you'll need to create a "public" property for all those properties you want to use in changeColor. More info at MDN
A live demo at jsFiddle.
The code above creates a custom property only to a specific HTML element. It's not recommended to create custom properties to the prototype of a DOM element, since those are not supported in all browsers.
element.style.color="red".