Append tag attributes
tagAppendAttributes(tag, ..., .cssSelector = NULL) tagHasAttribute(tag, attr) tagGetAttribute(tag, attr)
Arguments
tag |
a tag object. |
---|---|
... |
a collection of attributes. |
.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. |
Description
Append (tagAppendAttributes()
), check existence (tagHasAttribute()
),
and obtain the value (tagGetAttribute()
) of HTML attribute(s).
See also
tagAppendChildren()
, tagQuery()
Examples
html <- div(a()) tagAppendAttributes(html, class = "foo") tagAppendAttributes(html, .cssSelector = "a", class = "bar") tagHasAttribute(div(foo = "bar"), "foo") tagGetAttribute(div(foo = "bar"), "foo")