moved slider onChange from html to js function