0.0.4 • Published 4 years ago

lsec v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

🔎 lsec

GitHub issues GitHub license

Usage

To include lsec, install with npm.

npm i lsec

CDN

https://cdn.jsdelivr.net/npm/lsec/index.min.js

Examples

Finding the first element matching a class

import { ls } from "lsec";
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));