hyTags
HomeHome DocumentationDocumentation

class-exists

Checks if the selected element has a specific CSS class
Parameter
Type
Description
name
String
The name of the CSS class to check for
return
bool
Returns true if the element has the class, false otherwise
Test Case:Check existing class
    <div class="test-class"></div>
    
    <class-exists name="test-class">
    <assert-true>
    
    👆 Try to change something!
  • Test Case:Check non-existing class
      <div></div>
      
      <class-exists name="missing-class">
      <assert-false>
      
      👆 Try to change something!
    • Test succeeded Test failed