4.1.0 • Published 5 years ago

lit-selector v4.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

LitSelector

GitHub issues GitHub license

Usage

To include LitSelector, install with npm.

npm i lit-selector

CDN

https://cdn.jsdelivr.net/npm/lit-selector/index.min.js

Examples

Finding the first element matching a class

const el = ls(".myclass");

A more complex selector

const el = ls("div.user-panel.main input[name='login']");

Obtaining a list of matches

const container = ls("#test"); 
const matches = container.ls("div.highlighted > p");

Accessing the matches

Otherwise, you can simply use standard array notation to access the contents of the list. You can use any common looping statement, such as:

const users = ls(".users");      
users.forEach(userItem => console.log(userItem));
4.1.0

5 years ago

4.0.0

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.0.0

6 years ago