星期三, 七月 04, 2007

用Javascript和DOM完全动态建立一个Form

Form Element Interfa

1.建立一个提交的Form
// Create a form
var f = document.createElement("form");

// Add it to the document body
document.body.appendChild(f);

// Add action and method attributes
f.action = "/cgi-bin/some.cgi";
f.method = "POST"

// Call the form's submit method
f.submit();