Updated with JS document.write