Friday, September 30, 2011

prepend(<Content>)

prepend(<Content> content) returns jQuery

Prepend content to the inside of every matched element.

This operation is the best way to insert elements inside, at the beginning, of all matched elements.

Example:


Prepends some HTML to all paragraphs.
$("p").prepend("<b>Hello</b>");

HTML:
<p>I would like to say: </p>

Result:
<p><b>Hello</b>I would like to say: </p>

No comments:

Post a Comment