replace javascript code from .html to .js