Skip to content

Commit ea8317b

Browse files
committed
Update README.md
1 parent c95d4ee commit ea8317b

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
Get `NodeName`, `classList`, and `id` alongwith `width`, `height`, `display`, `padding`, `margin` and `border` of elements without opening Console.
66

7-
## Usage
7+
## Installation
8+
9+
**Dom Selector** can be loaded to any websites by placing any one of these codes on the `head` of the document.
810

911
```html
1012
<!-- Use Development CDN -->
@@ -15,6 +17,43 @@ Get `NodeName`, `classList`, and `id` alongwith `width`, `height`, `display`, `p
1517

1618
> Adding `defer` can help delay **Dom-Selector** loading, preventing it from increasing page load time.
1719
20+
## Usage
21+
22+
### Implementation
23+
24+
`DomSelector` can be called as a `Promise`.
25+
26+
```javascript
27+
// Call Dom-Selector
28+
DomSelector(); // returns Promise
29+
30+
// Or use top level async await function
31+
async function selector() {
32+
const element = await DomSelector();
33+
}
34+
35+
// Optionally it takes only one boolean parameter
36+
DomSelector(true); //This keeps the selection on the page until user closes it.
37+
```
38+
39+
> Name of the function `DomSelector` can be changed on the script file on local downloaded files.
40+
41+
### Options
42+
43+
An optional `boolean` parameter `showPreview` can be passed to keep selection in view until user closes it.
44+
45+
```javascript
46+
DomSelector(showPreview); // boolean value true|false
47+
```
48+
49+
### Auto Select
50+
51+
An `autoSelect` function can be called to show a start icon on the document by default.
52+
53+
```javascript
54+
DomSelector.autoSelect(showPreview); // returns :void
55+
```
56+
1857
## Limitation
1958

2059
* Restricted to top window only

0 commit comments

Comments
 (0)