converted jquery code to javascript in order to reduce dependencies and keep it lightweight

Quite a few websites do not have jquery, instead on injecting jquery into it, it was more reasonable to write the methods in pure javascript