jQuery: The Write Less, Do More JavaScript Library

Error: Failed to load processor NavWiki
No macro or processor named 'NavWiki' found

This code is part of the the jQuery Base? module.

DOM Modification Methods

attr(Attribute,Value)

Error: Failed to load processor param
No macro or processor named 'param' found

Description

Sets the attribute 'Name' in every matched element to 'Value'.

Examples

  $("p").attr("name","test");

attr(Hash)

Error: Failed to load processor param
No macro or processor named 'param' found

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)

Error: Failed to load processor param
No macro or processor named 'param' found

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)

Error: Failed to load processor param
No macro or processor named 'param' found

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)

Error: Failed to load processor param
No macro or processor named 'param' found

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)

Error: Failed to load processor param
No macro or processor named 'param' found

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)

Error: Failed to load processor param
No macro or processor named 'param' found

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)

Error: Failed to load processor param
No macro or processor named 'param' found

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>");