Rewrite live script using proper html5 methods and properties

Thanks again @padenot for the advices.