javascript splitted from html code