anyone able to translate this jquery code to Vanilla Javascript