update the snippets of JavaScirpt and html