JavaScript logic was taken away from html