Learn R Programming

linne (version 0.0.2)

selectors: Selectors

Description

Create selectors to select particular elements.

Usage

sel_id(value)

sel_input(value)

sel_all()

sel_class(value)

sel_tag(value)

sel_attr(attribute, value = NULL, tag = NULL)

Arguments

value

Value of selector.

attribute

Name of attribute.

tag

Name of tag.

Functions

  • sel_id() - Select an object by its id, e.g.: sel_id('btn') selects shiny::actionButton('btn', 'Button').

  • sel_all() - Selects everything.

  • sel_input() - Selects an input by its id, e.g.: sel_id('txt') selects shiny::textInput('txt', 'Text').

  • sel_class() - Select all elements bearing a specific class, e.g.: sel_class('cls'), selects shiny::h1('hello', class = 'cls').

  • sel_tag() - Select all tags, e.g.: sel_tag('p') selects p('hello').

  • sel_attr() - Select all tags with a specific attribute.

Details

The functions will print in the console the CSS selector they compose.

See Also

%with%, %or%, and %child% as well as when_active(), when_hover(), and when_focus() for more sophisticated element selection.

Examples

Run this code
# NOT RUN {
# select element where id = x
sel_id("x")

# select all elements with class = "container"
sel_class("container")

# }

Run the code above in your browser using DataLab