use pure javascript instead of jQuery