You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<desc>Escapes any character that has a special meaning in a CSS selector.</desc>
5
+
<signature>
6
+
<added>3.0</added>
7
+
<argumentname="selector"type="Selector">
8
+
<desc>A string containing a selector expression to escape.</desc>
9
+
</argument>
10
+
</signature>
11
+
<longdesc>
12
+
<p>This method is useful for situations where a class name or an ID contains characters that have a special meaning in CSS, such as the dot or the semicolon.</p>
13
+
<p>The method is essentially a shim for the <ahref="https://drafts.csswg.org/cssom/#the-css.escape()-method">CSS Working Group's CSS.escape() method</a>. The main difference is that <code>$.escapeSelector()</code> can be reliably used in all of jQuery's supported browsers.</p>
14
+
</longdesc>
15
+
<example>
16
+
<desc>Escape an ID containing a hash.</desc>
17
+
<code><![CDATA[
18
+
$.escapeSelector( "#target" ); // "\#target"
19
+
]]></code>
20
+
</example>
21
+
<example>
22
+
<desc>Select all the elements having a class name of <code>.box</code> inside a <code>div</code>.</desc>
0 commit comments