encode
Encode an attribute name
encoder.encode(attributeName)
Note: specific encoding may change, but encoded attributes can always be decoded using decode.
Parameters
- attributeName
{String}
:The attribute name.
Returns
{String}
:
The encoded attribute name.
var encodedAttributeName = encoder.encode("{(^$foo/bar baz)}");
div.setAttribute(encodedAttributeName, "attribute value");