First the following is the code of my own javascript library.

```
(function() {
    var lib = {
        elems: [],
        getElem: function() {
            var tmpElem = [];
            for (var i = 0; i < arguments.length; i++)
                tmpElem.push(document.getElementById(arguments[i]));
            this.elems = tmpElem;
            tmpElem = null;
            return this;
        },
        html: function(txt) {
            for (var i = 0; i < this.elems.length; i++)
                this.elems[i].innerHTML = txt;
            return this;
        },
        style: function(prob, val) {
            for (var i = 0; i < this.elems.length; i++)
                this.elems[i].style[prob] = val;
            return this;
        },
        addEvent: function(event, callback) {
            if (this.elems[0].addEventListener) {
                for (var i = 0; i < this.elems.length; i++)
                    this.elems[i].addEventListener(event, callback, false);
            } else if (this.elems[0].attachEvent) {
                for (var i = 0; i < this.elems.length; i++)
                    this.elems[i].attachEvent('on' + event, callback);
            }
            return this;
        },
        toggle: function() {
            for (var i = 0; i < this.elems.length; i++)
                this.elems[i].style.display = (this.elems[i].style.display === 'none' || '') ? 'block' : 'none';
            return this;
        },
        domLoad: function(callback) {
            var isLoaded = false;
            var checkLoaded = setInterval(function() {
                if (document.body && document.getElementById)
                    isLoaded = true;
            }, 10);
            var Loaded = setInterval(function() {
                if (isLoaded) {
                    clearInterval(checkLoaded);
                    clearInterval(Loaded);
                    callback();
                }
            }, 10);
        }
    };

    var fn = lib.getElem;
    for(var i in lib)
        fn[i] = lib[i];

    window.lib = window.$ = fn;
})();

```

Previously, I have used this way to use my own library, and works fine .

```
$.getElem('box').html('Welcome to my computer.');

```

But when updated the code of my own library, and I added

```
var fn = lib.getElem;
for(var i in lib)
   fn[i] = lib[i];

```

To be using the element selector like this way

```
$('box').html('Welcome to my computer.');

```

But the problem began appear when added the updated code to clone the lib object `TypeError: $(...).html is not a function`.

And now I want to use the element selector like that

```
$('box').html('Welcome to my computer.');

```

instead of

```
$.getElem('box').html('Welcome to my computer.');

```