toggle_attribute: Toggle a logical value into an attribute for an HTML tag

View source: R/HTML.R

toggle_attributeR Documentation

Toggle a logical value into an attribute for an HTML tag

Description

Attributes are set in HTML tags by setting them to NA. This is not very human-readable. It is more understandable to set them to TRUE to set the attribute and to FALSE not to set it.

Usage

toggle_attribute(x)

Arguments

x

logical value

Examples

library("shiny")
tags$input(name="Foo", required=toggle_attribute(FALSE))
tags$input(name="Foo", required=NULL)
tags$input(name="Foo", required=toggle_attribute(TRUE))
tags$input(name="Foo", required=NA)

jiho/yssr documentation built on Feb. 4, 2023, 7:48 p.m.