How to chain javascript methods.

by queryj

JavaScript

var d = document.createElement("div");
var t = document.createTextNode("test");
d.appendChild(t);
document.body.appendChild(d);

var d = document;
var b = document.body;
b.appendChild(d.createElement("div"))
.appendChild(d.createElement("p"))
.appendChild(d.createTextNode("testos"));