tagAppendAttributes | R Documentation |
Append (tagAppendAttributes()
), check existence (tagHasAttribute()
),
and obtain the value (tagGetAttribute()
) of HTML attribute(s).
tagAppendAttributes(tag, ..., .cssSelector = NULL)
tagHasAttribute(tag, attr)
tagGetAttribute(tag, attr)
tag |
a tag object. |
... |
Attributes to append as named argument-value pairs. A named
argument with an |
.cssSelector |
A character string containing a CSS selector
for targeting particular (inner) tags of interest. At the moment, only a
combination of
type (e.g,
|
attr |
The name of an attribute. |
tagAppendChildren()
, tagQuery()
html <- div(a())
tagAppendAttributes(html, class = "foo")
tagAppendAttributes(html, .cssSelector = "a", class = "bar")
tagAppendAttributes(html, contenteditable = NA)
tagHasAttribute(div(foo = "bar"), "foo")
tagGetAttribute(div(foo = "bar"), "foo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.