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
.های قدیمی یافت شود script هم گاهی به صورت پراکنده میتواند مفید باشد یا در `getElement(s)By` شده است، اما `querySelectorAll` و `querySelector` تا اینجا بیشترین استفاده از
383
383
384
384
385
-
Besides that:
385
+
علاوه بر آن:
386
386
387
-
- There is `elem.matches(css)` to check if `elem` matches the given CSS selector.
388
-
- There is `elem.closest(css)` to look for the nearest ancestor that matches the given CSS-selector. The `elem` itself is also checked.
387
+
.تطابق دارد یا نه CSS-selector با elem برای این استفاده میشود که چک کنیم `elem.matches(css)` از عبارت -
389
388
390
-
And let's mention one more method here to check for the child-parent relationship, as it's sometimes useful:
391
-
- `elemA.contains(elemB)` returns true if `elemB` is inside `elemA` (a descendant of `elemA`) or when `elemA==elemB`.
389
+
.هم چک میشود `elem` داده شده تطابق دارند. خود CSS-selector برای جستجوی نزدیکترین والدهایی است که با `elem.closest(css)` عبارت -
390
+
391
+
392
+
و بیایید اینجا یک روش دیگر برای بررسی رابطه والد و فرزند را چک کنیم،چون بعضی وقتها مفید است:
393
+
.را برمیگرداند true مثدار `elemA.contains(elemB)` باشد، عبارت `elemA==elemB` یا وقتی که (`elemA` از فرزندان) باشد `elemA` داخل `elemB` اگر -
0 commit comments