Imprint Interview Question

Rerwite this poorly written code in vanilla JS and HTML