cloning functionalities of jQuery