This demo uses the Trusted Types API to ensure untrusted HTML is sanitized through a Trusted Types policy before being assigned to innerHTML.
It uses a "tinyfill" for backwards compatibility.
Enter some HTML containing both safe formatting and unsafe scripts or event handlers:
innerHTML: