In the mail we often use to add attachments, now simple application:
Effect Chart:
Implementation principle:
Using table tags, the main idea: the table tag method
1, after clicking on the text, the automatic creation (originally is own/create, now get the Table object, you can InsertRow () InsertCell ()) to create rows and columns
2, delete the time through the parent node to remove
Core code:
function Creatmail () {
var Tab=document.getelementbyid ("TabID");
var tr=tab.insertrow ()//Insert row of
var Td=tr.insertcell ();//Insert a column of
var Td2=tr.insertcell ();//Insert a column
Td.innerhtml= "<input type= ' file ' value= ' Select files '/>";
/*
td2.innerhtml= "<a href= ' javascript:void (0) ' onclick= ' delrows (this) ' > Delete </a> ';
* *
td2.innerhtml= " ';
All the code is as follows (tips: Just implement add only)
The above is the entire content of this article, sharing the principle of implementation, core code, and we should most like the JavaScript to implement the implementation of add-on features of the lofty code, I hope to help you learn.