Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.

Commit de8e937

Browse files
committed
[yup]
1 parent 613e21f commit de8e937

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wrench-set",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ Returns **[undefined](https://developer.mozilla.org/docs/Web/JavaScript/Referenc
8383

8484
### getElement
8585

86-
returns the DOMElement for direct access
86+
returns the DOMElement for direct access or if querySelector is passed will return the matching child of the DOMElement
87+
88+
**Parameters**
89+
90+
- `querySelector` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** css selector to get the child of the element, if not provided, it will return the main element (optional, default `null`)
8791

8892
Returns **DOMElement**
8993

src/Element.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@ export default class Element {
5757
}
5858

5959
/**
60-
* returns the DOMElement for direct access
60+
* returns the DOMElement for direct access or if querySelector is passed will return the matching child of the DOMElement
6161
* @public
62+
* @param {string} [querySelector=null] css selector to get the child of the element, if not provided, it will return the main element
6263
* @returns {DOMElement}
6364
*/
64-
getElement() {
65+
getElement(querySelector) {
66+
if (querySelector)
67+
return this._____ELEMENT.querySelector(querySelector)
68+
6569
return this._____ELEMENT
6670
}
6771

0 commit comments

Comments
 (0)