makeHTMLTag: Make HTML Elements

Description Usage Arguments Details See Also Examples

View source: R/html.R

Description

Creates a function that returns a function that can be used to generate HTML elements. See examples for usage.

Usage

1

Arguments

tag

the HTML tag to use.

...

a collection of named and unnamed arguments; named arguments are parsed as attributes of the tag, unnamed arguments are pasted together into the inner data of the tag.

Details

This function returns a function that can be called as an HTML tag generating function. For example, by calling p <- makeHTMLTag("p"), we can generate a function that interprets all named arguments as attributes, and all unnamed arguments as 'data', which is generated for a p HTML tag.

See Also

html

Examples

1
2
3
4
div <- makeHTMLTag("div")
my_class = "orange"
x <- "some text"
div( class=my_class, id="hello", "This is ", x )

Kmisc documentation built on May 29, 2017, 1:43 p.m.

Related to makeHTMLTag in Kmisc...