polymerExample of Polymer toggleAttribute


Syntax

  1. toggleAttribute(name, bool, node)

Parameters

NameDetails
nameString: name of the HTML attribute which needs to be toggled
boolboolean: Boolean to force the attribute on or off. When unspecified, the state of the attribute will be reversed.
nodeHTMLElement: name of the node which contains the HTML attribute. Defaults to this

Remarks

A good example of this will be form, where submit button should only be active if all the mandatory fields have input.