There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.

This may take a few seconds.



set-property: (property) (boolean|"string") [html-entity-decode] [every (time)] [after (time)][, (property)...];

This command allows you to change the value of a property of an element - not a CSS style property. Just use a regular CSS command if you want to change a style property, or use the "style" command.

Sometimes you need to unset a dynamic property of an element. This command adds a property to the target selector if it doesn't exist, or replaces one if it is already there.

The property parameter is the name of the property you want to use.

The boolean parameter accepts "true" or "false" if your property needs to be true or false. You can can leave out the double-quotes for a boolean.

Or alternatively, the string parameter is what you want to set the property to. It requires double-quotes - these are currently not optional.

The optional html-entity-decode parameter will convert an html escaped string (eg. like "&lt;div&gt;")  into valid html (eg. "<div>") before inserting into an attribute. Internally, the JavaScript setAttribute command is used, so the result of adding straight HTML into an attribute does not break the DOM, even if the value looks like unescaped HTML.


Properties and attributes can sometimes be a bit confusing. But the confusion lies in the terms themselves rather than the behaviour, as they are not particularly descriptive terms. Simply put, you can think of properties as being changeable (like .value, .disabled, .draggable) and the attributes are what are actually in the html tag itself.

For some of the difference between properties and attributes and recommended use, see this page: