var id = 1;
function createTextbox() {
var text = new mini.TextBox();
var button = new mini.Button();
button.on("click", destroy);
button.setText("销毁");
var parent = document.getElementById("parent");
var div = document.createElement("div");
div.setAttribute("id", id);
div.innerHTML = "动态创建文本框";
parent.appendChild(div);
text.render(div);
button.render(div);
id = id + 1;
}
function destroy(e) {
var a = this.el.parentElement;
var id = a.id;
document.getElementById("parent").removeChild(document.getElementById(id));