The name read-only property of the TrustedTypePolicy interface returns the name of the policy.


var name =;


A DOMString containing the name of the policy.


In the below example a policy called myEscapePolicy is created using TrustedTypePolicyFactory.createPolicy() and is represented by the object escapeHTMLPolicy. Calling name on this object returns the string "myEscapePolicy".

const escapeHTMLPolicy = trustedTypes.createPolicy("myEscapePolicy", {
  createHTML: (string) => string.replace(/\>/g, "<")

console.log(; /* "myEscapePolicy" */


Specification Status Comment
Trusted Types
The definition of '' in that specification.
Editor's Draft Initial definition.

Browser compatibility

BCD tables only load in the browser