-
Book Overview & Buying
-
Table Of Contents
jQuery 1.4 Reference Guide
By :
These methods allow us to insert new content inside an existing element.
Insert content specified by the parameter at the beginning of each element in the set of matched elements.
.prepend(content) .prepend(function)
content: An element, an HTML string, or a jQuery object to insert at the beginning of each element in the set of matched elements
function: A function that returns an HTML string to insert at the beginning of each element in the set of matched elements
The jQuery object, for chaining purposes.
The .prepend() and .prependTo() methods perform the same task. The major difference is in the syntax, specifically in the placement of the content and target. With .prepend(), the selector expression preceding the method is the container into which the content is inserted. With .prependTo(), on the other hand, the content precedes the method either as a selector expression or as...
Change the font size
Change margin width
Change background colour