Web features explorer

CSS.escape()

Widely available since 2022-07-15
Tags: api Groups: CSS > CSS object models

The CSS.escape() static method escapes a string so that it can be used in a valid CSS selector.

Learning resources on MDN

Browser support