This code is part of the the jQuery Base? module.
DOM Modification Methods
attr(Attribute,Value)
Description
Sets the attribute 'Name' in every matched element to 'Value'.
Examples
$("p").attr("name","test");
attr(Hash)
Description
Takes a hash of name/value pairs and for every matched element, sets each Name property to Value.
Examples
$("p").attr({name:"test",title:"Welcome!"});
html(String)
Description
Sets the entire inner html of all matched elements to the HTML string provided as an argument.
Examples
$("p").html("Some text <b>and bold!</b>");
remove()
Description
Removes all the currently selected elements from the DOM. This is more explicit then hide(), for example, in that the elements physically no longer exist.
Examples
$("p").remove();
append(String OR DOMElement List OR DOMElement Array)
Description
Appends the HTML string (or the list of DOMElements, or the array of DOMElements) to the end (of the inside) of each element matched.
Examples
$("p").append("Some text <b>and bold!</b>");
prepend(String OR DOMElement List OR DOMElement Array)
Description
Same as append, but inserts the HTML at the top of the inside of each element matched.
Examples
$("p").prepend("Some text <b>and bold!</b>");
before(String OR DOMElement List OR DOMElement Array)
Description
Same as append, but inserts the HTML before each element matched.
Examples
$("p").before("Some text <b>and bold!</b>");
after(String OR DOMElement List OR DOMElement Array)
Description
Same as append, but inserts the HTML after each element matched.
Examples
$("p").after("Some text <b>and bold!</b>");
wrap(String OR DOMElement List OR DOMElement Array)
Description
Wraps HTML around the contents of each matched element. For example, running the below code will turn all P elements into <div class='ohmy'><p>...</p></div>.
Examples
$("p").wrap("<div class='ohmy'></div>");