Separate Javascript code from HTML