|
before()Insert content before 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: after(). before(content)Before(content) inserts content before each element in the set of elements that match the script's selector. Before() creates a new result set. content String, HTML string or result set to insert after the 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 for an element with the ID
This script does the same, but it uses the query() function to look up the element.
The following script looks for an element with the ID salesrep, inserts a paragraph before that element and colors that element red.
Note: the way the functions
The following script searches the results for the string "ipsum" and puts "Lorem " before it. "Lorem " is automatically wrapped in a Span element.
The following script looks for an element with the ID salesrep and inserts the text "Lorem Ipsum" before that element. "Lorem Ipsum" is automatically wrapped in a Span element.
|
|