|
query()
This function creates a new result set, containing the HTML elements in the current section that match the supplied CSS selector. The context (optional) allows you to restrict the search to descendants of one or more context elements. The new result set is of the type query(selector)Creates a new result set containing the HTML elements in the current section that match the supplied CSS selector. selector A String containing a CSS selector. See http://www.w3schools.com/cssref/css_selectors.asp for CSS selectors and combinations of CSS selectors. ExamplesLook for an element with a certain IDThis scripts applies a style rule to the queried elements.
Look for an element in a snippetThe following script loads a snippet. Then it looks up an element in a snippet and sets its text. Finally, it replaces the elements matched by the script's selector by the snippet.
query(selector, context)Creates a new result set containing the HTML elements that match the supplied CSS selector. The context (optional) allows you to restrict the search to descendants of one or more context elements. selector A String containing a CSS selector. See http://www.w3schools.com/cssref/css_selectors.asp for CSS selectors and combinations of CSS selectors. context A result set (the result of another query) or an HTML string. If the passed context is not a result set or HTML string it will be coerced to a String and interpreted as HTML. ExamplesThis script performs a query in the results of another query.
Since the
query(html)Creates a new HTML element on the fly from the provided string of raw HTML, and returns the new element. html A String containing a HTML element. Tags that can contain other elements should be paired with a closing tag. ExampleThe following script adds a paragraph to the
The Dynamic Attachment script uses this function to add an attachment to an Email section; see Email attachments.
|
|