Edit this page

up.element up.element.style(element, propOrProps)
JavaScript function

Receives computed CSS styles for the given element.

Examples

When requesting a single CSS property, its value will be returned as a string:

value = up.element.style(element, 'font-size')
// value is '16px'

When requesting multiple CSS properties, the function returns an object of property names and values:

value = up.element.style(element, ['font-size', 'margin-top'])
// value is { 'font-size': '16px', 'margin-top': '10px' }

Parameters

element Element
propOrProps stringorArray

One or more CSS property names in kebab-case or camelCase.

Return value

stringorObject