From a3e45d8ced63369ad6bd29ce45d919b77412a99b Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 31 Aug 2018 21:00:29 +0200 Subject: add information about valid selectors (#27137) --- site/docs/4.1/getting-started/javascript.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'site/docs/4.1/getting-started/javascript.md') diff --git a/site/docs/4.1/getting-started/javascript.md b/site/docs/4.1/getting-started/javascript.md index 20500c2af..e9fcc5182 100644 --- a/site/docs/4.1/getting-started/javascript.md +++ b/site/docs/4.1/getting-started/javascript.md @@ -35,8 +35,10 @@ $(document).off('.alert.data-api') {% endhighlight %} {% capture callout %} -##### Escaping selectors -If you use special selectors, for example: `collapse:Example`, be sure to escape them, because they'll be passed through jQuery. +## Selectors + +Currently to query DOM elements we use the native methods `querySelector` and `querySelectorAll` for performance reasons, so you have to use [valid selectors](https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier). +If you use special selectors, for example: `collapse:Example` be sure to escape them. {% endcapture %} {% include callout.html content=callout type="warning" %} -- cgit v1.2.3