Separate javascript code from HTML