Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>autoQueryNew to Visual Studio Code? Get it now.
autoQuery

autoQuery

Juan Figueroa

|
22 installs
| (1) | Free
Automatically generate JavaScript querySelector variables for HTML elements in your project. Stop typing selectors manually!
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HTML to QuerySelector

Automate your DOM selection! Select an HTML element, name your variable, and pick a JS/TS file—it generates a querySelector for you.

Features

  • Select HTML → Custom variable name → Insert in JS/TS file.
  • Smart file picker with autocomplete.
  • Stays in your current file for smooth workflow.

Usage

  1. Highlight an HTML element (e.g., <div id="myDiv">).
  2. Run Get HTML Selection (or Ctrl+Shift+Q).
  3. Name your variable.
  4. Pick a JS/TS file if needed.

Why?

Saves time, reduces typos, keeps you coding—not copying.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft