hyTags
HomeHome DocumentationDocumentation

selection-has-focus

Checks if the selected element currently has focus.
Parameter
Type
Description
return
bool
True if the element is the active element, false otherwise
Test Case:Check if focused input has focus
    <input type="text">
    
    <selection-focus>
    <selection-has-focus>
    <assert-true>
    
    👆 Try to change something!
  • Test Case:Check if unfocused element has focus
      <input type="text">
      
      <selection-has-focus>
      <assert-false>
      
      👆 Try to change something!
    • Test succeeded Test failed