escape

fun escape(ident: String): String(source)

The CSS.escape() static method returns a string containing the escaped string passed as parameter, mostly for use as part of a CSS selector.

MDN Reference