Limited availability
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The setDataAttributes()
method of the Sanitizer
interface sets whether data attributes will be allowed or removed by the sanitizer.
The method sets the dataAttributes
property in this sanitizer's configuration.
setDataAttributes(allow);
Parameters
allow
true
if data attributes are allowed, and false
if they are to be removed.
None (undefined
).
The code below shows the basic usage of the setDataAttributes()
method.
// Create sanitizer (in this case the default)
const sanitizer = new Sanitizer();
// Allow data attributes
sanitizer.setDataAttributes(true);
// Remove data attributes
sanitizer.setDataAttributes(false);
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4