Use createElement and appendChild
JavaScript code:
function extend(m, e){
var e = e || this;
for (var x in m) e[x] = m[x];
return e;
};
function create(type, opt, parent){
var el = document.createElement(type);
if (opt.style){
extend(opt.style,el.style);
}
delete opt.style;
extend(opt,el);
if (parent){
parent.appendChild(el);
}
return el;
}
function add_input(){
create("input", {type: "text"}, document.getElementById('input_container'));
create("br", {}, document.getElementById('input_container'));
//document.getElementById('input_container').innerHTML += '<input type="text"><br />';
}
this should do the trick