Rewrite without jQuery