When you want to download any html thing just pass the container name as input to the java script. and that container will get downloaded with the data contain in it.