TAILIEUCHUNG - Học JavaScript qua ví dụ part 73

Loại bỏ một Node Nếu bạn muốn tự động loại bỏ một bài viết từ một blog hoặc một thành phần từ một công thức trực tuyến, nó có thể được thực hiện với DOM. Để xóa một phần tử hoặc nút từ cây DOM, chúng tôi sử dụng removeChild () phương pháp. Phương pháp này phải được gọi từ nút cha mẹ bởi vì bạn sẽ được loại bỏ một đứa con | Modifying the DOM Appending Copying and Removing Nodes 653 EXPLANATION continued 4 A reference to a new div is returned. 5 The cloned table is appended to the div just below the original table see Figure . 6 This is the div container for the cloned table. Figure Cloning a table with a unique id. Removing a Node If you want to dynamically remove a post from a blog or an ingredient from an online recipe it can be done with the DOM. To delete an element or node from the DOM tree we use the removeChildO method. This method must be called from the parent node because you will be removing a child. It takes a reference to the child it will remove as its only argument. The following examples demonstrate how to dynamically remove nodes with JavaScript and the DOM. The first example Example removes a div and its contents the second example Example removes paragraphs. From the Library of .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.