I have a function $ that returns element by its Id, the code is something like this:
Code:
function $(element){
  if(typeof(element) == 'string'){
    return document.getElementById(element);
  }
}
I want to extend the object that this function returns with some functions like 'show', 'hide', 'opacity' etc. Prototype an jQuery are written this way.
So I want to type this:
Code:
$('elementname').hide();
for hidding the given element. It's not the problem in changinh the style of element, but in extending the $ function.