pz_get_attr() returns the named attribute of every element matching
target, one entry per match. Missing attributes give NA.
Arguments
- ctx
A paparazzi context.
- name
The attribute name.
- target
A CSS selector string, a
pz_loc()spec, or a list of specs and strings (a union matching any of them).NULLmeans the current context: the pinned set at a scoped context, or the page body at the root.- ...
Checked empty; reserved for future use.
Examples
page <- pz_open(pz_example("tasks"))
pz_get_attr(page, "data-priority", target = ".task")
#> [1] "high" "high" "normal" "low" "normal" "low" "normal"
# Missing attributes are NA
pz_get_attr(page, "aria-label", target = "select, input[type='text']")
#> [1] NA "Priority"
pz_close(page)
