Applied unobtrusive javascript solution. Separated javascript from html code.