for the first part of your question do the following:
var container = document.getElementById("mainForm:table_1").parentNode; var content = container.innerHTML container.innerHTML= content;
and for the second part of your question, like @JITHIN PV, you should use history.js
you can easily use it as follows:
var History = window.History; History.enabled ; History.pushState("object or string", "object or string", "object or string");
source share