<div id="errorBar" onclick="selectElement(this).hide()">123</div>
<script>
function selectElement( elem ) {
return new selectElement.prototype.init( elem );
}
selectElement.prototype = {
constructor: selectElement,
length: 0,
init: function( elem ) {
this[0] = elem;
this.length = 1;
return this;
},
hide: function() {
var elem, i = this.length;
for( ;elem = this[ --i ]; ) {
elem.style.display = 'none';
}
return this;
}
}
selectElement.prototype.init.prototype = selectElement.prototype;
</script>