Adding/removing DOM elements
This recipe demonstrates how to clone elements on the DOM. We will also see how to remove elements completely from the DOM tree. The programming constructs used in this example are summarized in the following table:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This selects an element based on its ID |
|
jQuery selector |
This selects all elements with the specified HTML tag. |
|
jQuery method |
This adds the specified |
|
jQuery method |
This returns a string with the required attribute value of the first matched element. It can also be used to set the attribute to the required value. |
|
jQuery selector |
This selects an element with the specified attribute equal to the |
|
jQuery method |
This inserts elements at the end of the target. |
|
jQuery event |
This is fired when you click on an... |