Rewrite without jquery