blockly > utils > dom > hasClass
Funkcja utils.dom.hasClass()
Sprawdza, czy element ma określoną klasę CSS.
Podpis:
export declare function hasClass(element: Element, className: string): boolean;
Parametry
Parametr |
Typ |
Opis |
element |
Element |
Element DOM do sprawdzenia. |
nazwaklasy |
ciąg znaków |
Nazwa zajęć do sprawdzenia. |
Zwroty:
wartość logiczna
Wartość „prawda”, jeśli klasa istnieje. W przeciwnym razie wartość „false”.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-22 UTC.
[null,null,["Ostatnia aktualizacja: 2024-08-22 UTC."],[[["The `utils.dom.hasClass()` function determines if a given DOM element possesses a specific CSS class."],["It accepts two arguments: the DOM element to examine and the name of the CSS class to check for."],["The function returns `true` if the element has the specified class and `false` otherwise."]]],[]]