tchmi_css_escape_selector

[ Function ]

function tchmi_css_escape_selector(id: string): string;

Converts a string into a valid CSS ID pattern by masking all reserved characters.

Parameter

Name

Type

Description

id

string

The string to be masked

Return value

Type

Description

string

The converted ID.

tchmi_css_escape_selector 1:

Available from version 1.12

Sample - JavaScript

TcHmi.Log.debug(tchmi_css_escape_selector('.test')); // '\\.test'