Learning to make library like jquery