Skip to main content
Skip table of contents

class

An HTML content command for setting the "class" attribute on an element.

The host element's "class" is set to whatever String this command's primary attribute resolves into. Note that this will overwrite any existing "class" value on the element.   

This command has a priority of 15.

Examples

This content command can come useful in looped content to have the content produced in different loop rounds have visual differences. If, for example, there's a list of tasks, the tasks' list items could receive a different class based on their completion status.

CODE
<ul><li dyn-repeat="tasks" dyn-repeat-var="task" dyn-class="task.isComplete ? 'completeTask' : 'incompleteTask'" dyn-content="task.subject">task</li></ul>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.