Adding pure js solution