Node.js examples for HTML:Element
A generic function to create form elements
function createFormElement(element, type, name, id, value, parent) { var e = document.createElement(element); e.setAttribute("name", name); e.setAttribute("type", type); e.setAttribute("id", id); e.setAttribute("value", value); parent.appendChild(e);/*from ww w .ja v a 2 s . c om*/ }