How to add attachments using javascript _ javascript skills

Source: Internet
Author: User
This article mainly introduces how to add an attachment using javascript. when editing information, we sometimes need to append files and images to implement the upload function. through this article, we will learn how javascript implements the additional function, please read. We often use adding attachments in emails. The following is a simple application:
:

Implementation principle:
Using table labels: using table labels
1. after clicking the text, it will be automatically created (originally self/created. now, after getting the table object, you can create rows and columns in insertRow () insertCell ().
2. the parent node is used to remove the deleted data.
Core code:

Function creatMail () {var tab = document. getElementById ("tabid"); var tr = tab. insertRow (); // insert a line var td = tr. insertCell (); // Insert a column var td2 = tr. insertCell (); // Insert a column of td. innerHTML ="";/* Td2.innerHTML =" delete "; */td2.innerHTML = "";}

All the code is as follows (tips: just implement add)

     
     AddMail.html    
   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.