Problem 2 solved.
Problem 3 solved.
Javascript in html file.