hyTags
HomeHome DocumentationDocumentation

attribute-exists

Checks if an attribute exists on an element
Parameter
Type
Description
name
String
The name of the attribute to check
return
bool
True if the attribute exists, false otherwise
Test Case:Check existing attribute
    <div id="exists"></div>
    
    <attribute-exists name="id">
    <assert-true>
    
    👆 Try to change something!
  • Test Case:Check non-existing attribute
      <div></div>
      
      <attribute-exists name="missing">
      <assert-false>
      
      👆 Try to change something!
    • Test succeeded Test failed