Skip to content

Commit 686f052

Browse files
authored
Added clarity in selector paths
1 parent 4f482ce commit 686f052

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/guides/selectors.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,16 @@ Here is an example of what NOT to do, but this demonstrates how the selector wor
208208
209209
In the BAD example above, we are specifying a very precise path to an input element in the DOM, starting from the very top of the document.
210210
211-
Similarly, the relative XPath selector is a double forward slash `//`. It is used to start searching for an element anywhere in the DOM.
211+
Similarly, the relative XPath selector is a double forward slash `//`. It is used to start searching for an element anywhere in the DOM starting from the element preceedingly defined. If no element is defined before, the entire DOM is searched.
212212
213213
Example:
214214
215215
```xpath
216216
//div[@class=’form-group’]//input[@id='user-message']
217217
```
218218
219+
In the GOOD example above, all <div class='form-group'/> elements in the DOM are matched first, and then all <input id='user-message'/> with <div class='form-group'/> as one of its parents is matched. Doesn't matter if the parent is anywhere up in the parent hierarchy.
220+
219221
#### Parent Selectors
220222
221223
The parent selector (`..`) allows you to jump to the parent element.

0 commit comments

Comments
 (0)