Virtual Classes Logo          Virtual Classes
    Read Anytime,Anywhere

Modify Page Content

Following are the method provided by JQuery to modify page contents.
1-append() - Inserts content at the end of the selected elements
Example: $("p").append("Some appended text.");

2-prepend() - Inserts content at the beginning of the selected elements
Example: $("p").prepend("Some prepended text.");

3-after() - Inserts content after the selected elements
Example:$("img").after("Some text after");

4-before() - Inserts content before the selected elements
Example:$("img").before("Some text before");

5-remove() -Removes the selected element (and its child elements)

6-empty() -Removes the child elements from the selected element

7-attr()-JQuery attr()method is also used to set/change attribute values.
$("#coName").attr("href", “");

The attr() method also allows you to set multiple attributes at the same time.
      "href" : "",
      "title" : “Training on Jquery"      });