SkillAgentSearch skills...

Qs2el

Create elements from query selector strings.

Install / Use

/learn @WebReflection/Qs2el
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

qs2el

<sup>Social Media Photo by Matheus Frade on Unsplash</sup>

Build Status Coverage Status WebReflection status

Create an element from a query selector string.

// as function
const a = qs2el('a#home.special[data-page=home]');

// or as literal
const button = qs2el`button${'.primary'}[disabled]`;

The exported function also have an .escape(value) to safely parse text that might contain [ or ] chars.

const value = 'this [might] be an issue';
const div = qs2el`div[data-blob=${qs2el.escape(value)}]`;

div.dataset.blob === value; // true
View on GitHub
GitHub Stars14
CategoryDevelopment
Updated11mo ago
Forks0

Languages

JavaScript

Security Score

82/100

Audited on Apr 17, 2025

No findings