hyTags
HomeHome DocumentationDocumentation

selection-scope

Creates a temporary selection scope for executing commands.
Parameter
Type
Description
element
Element?
Element to select directly
global
Selector?
CSS selector to find element globally
parent
Selector?
CSS selector to find among parent elements
enclosing
Selector?
CSS selector to find enclosing element
first-child
Selector?
CSS selector to find among first children
last-child
Selector?
CSS selector to find among last children
first-descendant
Selector?
CSS selector to find first descendant
last-descendant
Selector?
CSS selector to find last descendant
next-sibling
Selector?
CSS selector to find among next siblings
previous-sibling
Selector?
CSS selector to find among previous siblings
return
Type?
Type to return from the scope (optional)
commands
Commands
Commands to execute within the scope
return
void
Void
Test Case:Execute commands in scope
    <div><span>child</span></div>
    
    <selection-scope first-child="span" return="string">
      <selection-get-text>
    </selection-scope>
    <assert-equal value="child" type="string">
    
    👆 Try to change something!
  • Test succeeded Test failed