|
after()Insert content after each element in the set of HTML elements that match the selector of the script or of another query in the template (see query()). See also: before(). after(content)Insert content after each element in the set of HTML elements that match the selector of the script, or of another query in the template (see query()). After creates a new result set. content String, HTML string or result set to insert after the matched elements. In case a plain text string is provided, it is automatically wrapped in a <span> element to avoid orphan text nodes to appear in the <body> element. ExamplesThis script looks up an element with the ID #salesrep and inserts a paragraph after it.
This script looks up an element with the ID #salesrep, sets its text color to red and inserts a paragraph after it.
Note: the way the functions after() and css() are used in this script is called 'chaining'. Chaining is optional; the same could be achieved by storing the result of the query in a variable:
The following script inserts a paragraph after the elements in the
This script looks for the string "Lorem " in the
This script looks up an element with the ID #salesrep and inserts a string after it. The string is automatically enclosed in a span.
|
|