SO - 18226598

by Arun P Johny

HTML

<button onclick="test()">Insert after</button>

JavaScript

function test() {
    var r=$('<input/>').attr({
        type: "button",
        id: "field",
        value: 'new'
    });
    $("body").append(r);    
}