change some jQuery to javascript