(add-class! content class)
Adds the specified CSS class to each node in the content.
Adds the specified CSS class to each node in the content.
(ancestor? ancestor-content descendant-content)
Returns true if the first argument is an ancestor of the second argument. Presumes both arguments are single-node contents.
Returns true if the first argument is an ancestor of the second argument. Presumes both arguments are single-node contents.
(append! parent-content child-content)
Given a parent and child contents, appends each of the children to all of the parents. If there is more than one node in the parent content, clones the children for the additional parents. Returns the parent content.
Given a parent and child contents, appends each of the children to all of the parents. If there is more than one node in the parent content, clones the children for the additional parents. Returns the parent content.
(attr content the-name)
Gets the value of an HTML attribute. Assumes content will be a single node. Name may be a stirng or keyword. Returns nil if there is no value set for the style.
Gets the value of an HTML attribute. Assumes content will be a single node. Name may be a stirng or keyword. Returns nil if there is no value set for the style.
(attrs content)
Returns a map of the HTML attributes/values. Assumes content will be a single node. Attribute names are returned as keywords.
Returns a map of the HTML attributes/values. Assumes content will be a single node. Attribute names are returned as keywords.
(by-class class-name)
Returns content containing nodes which have the specified CSS class.
Returns content containing nodes which have the specified CSS class.
(by-id id)
Returns content containing a single node by looking up the given ID
Returns content containing a single node by looking up the given ID
(children content)
Gets all the child nodes of the elements in a content. Same as (xpath content '*') but more efficient.
Gets all the child nodes of the elements in a content. Same as (xpath content '*') but more efficient.
(classes content)
Returns a seq of all the CSS classes currently applied to a node. Assumes content is a single node.
Returns a seq of all the CSS classes currently applied to a node. Assumes content is a single node.
(clone content)
Returns a deep clone of content.
Returns a deep clone of content.
(common-ancestor & contents)
Returns the deepest common ancestor of the argument contents (which are presumed to be single nodes), or nil if they are from different documents.
Returns the deepest common ancestor of the argument contents (which are presumed to be single nodes), or nil if they are from different documents.
(destroy! content)
Removes all the nodes in a content from the DOM. Returns nil.
Removes all the nodes in a content from the DOM. Returns nil.
(destroy-children! content)
Removes all the child nodes in a content from the DOM. Returns the original content.
Removes all the child nodes in a content from the DOM. Returns the original content.
(detach! content)
Removes all the nodes in a content from the DOM and returns them.
Removes all the nodes in a content from the DOM and returns them.
(nodes content)
Returns the content as a sequence of nodes.
Returns the content as a sequence of nodes.
(single-node nodeseq)
Returns the content as a single node (the first node, if the content contains more than one
Returns the content as a single node (the first node, if the content contains more than one
(get-data node key)
(get-data node key bubble)
Returns data associated with a node for a given key. Assumes content is a single node. If the bubble parameter is set to true, will search parent nodes if the key is not found.
Returns data associated with a node for a given key. Assumes content is a single node. If the bubble parameter is set to true, will search parent nodes if the key is not found.
(has-class? content class)
Returns true if the node has the specified CSS class. Assumes content is a single node.
Returns true if the node has the specified CSS class. Assumes content is a single node.
(html content)
Returns the innerHTML of a node. Assumes content is a single node.
Returns the innerHTML of a node. Assumes content is a single node.
(html-to-dom html)
takes an string of html and returns a NodeList of dom fragments
takes an string of html and returns a NodeList of dom fragments
(insert! parent-content child-content idx)
Given a parent and child contents, appends each of the children to all of the parents at the specified index. If there is more than one node in the parent content, clones the children for the additional parents. Returns the parent content.
Given a parent and child contents, appends each of the children to all of the parents at the specified index. If there is more than one node in the parent content, clones the children for the additional parents. Returns the parent content.
(insert-after! content new-content)
Given a content and some new content, inserts the new content immediately after the reference content. If there is more than one node in the reference content, clones the new content for each one.
Given a content and some new content, inserts the new content immediately after the reference content. If there is more than one node in the reference content, clones the new content for each one.
(insert-before! content new-content)
Given a content and some new content, inserts the new content immediately before the reference content. If there is more than one node in the reference content, clones the new content for each one.
Given a content and some new content, inserts the new content immediately before the reference content. If there is more than one node in the reference content, clones the new content for each one.
(log & mesg)
(log-debug & mesg)
(normalize-seq list-thing)
Some versions of IE have things that are like arrays in that they respond to .length, but are not arrays nor NodeSets. This returns a real sequence view of such objects. If passed an object that is not a logical sequence at all, returns a single-item seq containing the object.
Some versions of IE have things that are like arrays in that they respond to .length, but are not arrays nor NodeSets. This returns a real sequence view of such objects. If passed an object that is not a logical sequence at all, returns a single-item seq containing the object.
(parse-style-attributes style)
Parses a CSS style string and returns the properties as a map.
Parses a CSS style string and returns the properties as a map.
(prepend! parent-content child-content)
Given a parent and child contents, prepends each of the children to all of the parents. If there is more than one node in the parent content, clones the children for the additional parents. Returns the parent content.
Given a parent and child contents, prepends each of the children to all of the parents. If there is more than one node in the parent content, clones the children for the additional parents. Returns the parent content.
(remove-attr! content the-name)
Removes the specified HTML property for each node in the content. Name may be a string or keyword.
Removes the specified HTML property for each node in the content. Name may be a string or keyword.
(remove-class! content class)
Removes the specified CSS class from each node in the content.
Removes the specified CSS class from each node in the content.
(set-attr! content the-name & value)
Sets the value of an HTML property for each node in the content. Name may be a string or keyword. Value will be cast to a string, multiple values wil be concatenated.
Sets the value of an HTML property for each node in the content. Name may be a string or keyword. Value will be cast to a string, multiple values wil be concatenated.
(set-attrs! content attrs)
Sets the specified attributes for each node in the content, given a map of names and values. Names may be a string or keyword. Values will be cast to a string, multiple values wil be concatenated.
Sets the specified attributes for each node in the content, given a map of names and values. Names may be a string or keyword. Values will be cast to a string, multiple values wil be concatenated.
(set-classes! content classes)
Sets the class attribute of the content nodes to classes, which can be either a class attribute string or a seq of classname strings.
Sets the class attribute of the content nodes to classes, which can be either a class attribute string or a seq of classname strings.
(set-data! node key value)
Sets a data on the node for a given key. Assumes content is a single node. Data should be ClojureScript values and data structures only; using other objects as data may result in memory leaks on some browsers.
Sets a data on the node for a given key. Assumes content is a single node. Data should be ClojureScript values and data structures only; using other objects as data may result in memory leaks on some browsers.
(set-html! content inner-content)
Sets the innerHTML value for all the nodes in the given content.
Sets the innerHTML value for all the nodes in the given content.
(set-style! content the-name & value)
Sets the value of a CSS property for each node in the content. Name may be a string or keyword. Value will be cast to a string, multiple values wil be concatenated.
Sets the value of a CSS property for each node in the content. Name may be a string or keyword. Value will be cast to a string, multiple values wil be concatenated.
(set-styles! content styles)
Sets the specified CSS styles for each node in the content, given a map of names and values. Style names may be keywords or strings.
Sets the specified CSS styles for each node in the content, given a map of names and values. Style names may be keywords or strings.
(set-text! content value)
Sets the text value of all the nodes in the given content.
Sets the text value of all the nodes in the given content.
(set-value! content value)
Sets the value of all the nodes (presumably form fields) in the given content.
Sets the value of all the nodes (presumably form fields) in the given content.
(style content the-name)
Gets the value of a CSS property. Assumes content will be a single node. Name may be a string or keyword. Returns nil if there is no value set for the style.
Gets the value of a CSS property. Assumes content will be a single node. Name may be a string or keyword. Returns nil if there is no value set for the style.
(styles content)
Returns a map of the CSS styles/values. Assumes content will be a single node. Style names are returned as keywords.
Returns a map of the CSS styles/values. Assumes content will be a single node. Style names are returned as keywords.
(swap-content! old-content new-content)
Given some old content and some new content, replaces the old content with new content. If there are multiple nodes in the old content, replaces each of them and clones the new content as necessary.
Given some old content and some new content, replaces the old content with new content. If there are multiple nodes in the old content, replaces each of them and clones the new content as necessary.
(text content)
Returns the text of a node. Assumes content is a single node. For consistency across browsers, will always trim whitespace of the beginning and end of the returned text.
Returns the text of a node. Assumes content is a single node. For consistency across browsers, will always trim whitespace of the beginning and end of the returned text.
(toggle-class! content class)
Toggles the specified CSS class from each node in the content.
Toggles the specified CSS class from each node in the content.
(value content)
Returns the value of a node (presumably a form field). Assumes content is a single node.
Returns the value of a node (presumably a form field). Assumes content is a single node.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close