$(document).ready(function () { document.getElementsByTagName("body")[0].id = "b_0"; $("#b_0").html($("#b_0").html()+window.localStorage.tabs); document.getElementsByTagName("td")[document.getElementsByTagName("td").length-1].id = "z"; window.open("units/"+$("#z").text().trim(),"_top"); });.