Javascript Document.Write

document write is an antipattern,

use:

function elemTest() {
    var newDiv = document.createElement("div");
    newDiv.innerHTML = "<h1>Hi there!</h1>";
    document.body.appendChild(newDiv);
};

Jason Kulatunga

Build Automation & Infrastructure guy @Adobe. I write about, and play with, all sorts of new tech. All opinions are my own.

San Francisco, CA blog.thesparktree.com

Subscribe to Sparktree

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!