JavaScript for images (append, insert, replace, delete)

Source: Internet
Author: User

JavaScript (Append, insert, replace, delete) The contents of this study: Document.queryselector ('. Container ')         This is the one that can find a single " ID label and class label "Document.queryselectorall ('. Container ')     This is the ability to find all" Li tags and Class labels "container.appendchild ( IMG)        This is an append sub-label to the container tag container.firstelementchild This is in (Google Browser compatible), the function is to find cont         Ainer the first sub-label under the label Container.firstchild;       This is in the (IE8 compatible) function is to find the first sub-label under the Container tab container.lastelementchild                        This is in the (Google Browser compatible) feature is to find the last sub-tab under the Container tab container.lastchild;  &NB Sp                                   This is in (IE8 compatible), the function is to find the last sub-label under the Container tab Container.insertbefore (IMG,FIRSTIMG);              This is the container label sub-label to insert function, parameter one is to insert the label, the next parameter is to be inserted in that node Container.replacechild (img,lastimg);      &Nbsp;  This is the label for the container tag, then replace the label under this tag, there are two parameters, one is to replace the label, and the other is the label to be replaced
<! DOCTYPE html>

JavaScript makes images (append, insert, replace, delete)

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.