JS implemented in a HTML5 way