console.log($('#mydiv'))
console.dir($('#mydiv'));
<div id="div">text</div> <script type="text/javascript"> function $(id) { if (this.$) return new $.wrapper(id); } $.wrapper = function(id) { if(typeof id == 'string' /* etc ... */) this.id = document.getElementById(id); }; $.wrapper.prototype = $.prototype = { constructor: $, css: function(value) { for(i in value) { this.id.style[i] = value[i]; } return this; } /* , .... */ }; $('div').css({'color':'red', 'textTransform':'uppercase'}); </script>