Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>HTML Attribute IntelliSenseNew to Visual Studio Code? Get it now.
HTML Attribute IntelliSense

HTML Attribute IntelliSense

Tuff

|
7 installs
| (0) | Free
Autocompletes HTML id, class, name, and tag values inside your JavaScript/TypeScript code, including jQuery selectors.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HTML Attribute IntelliSense

Autocompletes HTML id, class, name, and tag values while you're writing JavaScript / TypeScript — no need to memorize or copy-paste them.

What it does

While an HTML file is open in the same VS Code window, typing one of these in a JS/TS file will suggest the matching values:

You type You get suggested
document.getElementById(" all id="..." values
document.getElementsByClassName(" all class="..." values
document.getElementsByTagName(" all tag names used (div, button, ...)
document.getElementsByName(" all name="..." values
document.querySelector("# ids
document.querySelector(". classes
document.querySelector(" both, shown as #id / .class
$("# ids
$(". classes
$(" both, shown as #id / .class

It also works with querySelectorAll and jQuery(...) (the same rules as $(...)).

Install

  1. Open the Extensions view in VS Code (Ctrl+Shift+X / Cmd+Shift+X).
  2. Search for "HTML Attribute IntelliSense".
  3. Click Install.

Once installed, it's active automatically for JS/TS/JSX/TSX files — no setup needed.

Usage

  1. Open your .html file in a tab (it just needs to be open — doesn't need to be active).
  2. Open your .js file.
  3. Start typing one of the patterns from the table above — suggestions pop up automatically as you type, and keep narrowing down as you type more letters (e.g. #a only shows ids starting with "a").
  4. If you click away and then click back inside the same quotes, the suggestion list reopens on its own — no need to press Ctrl+Space, though that still works too if you ever want to force it.

Recent Improvements

  • Suggestions now reopen automatically when you click back into an already open pair of quotes, instead of only appearing the first time you type into them (or after pressing Ctrl+Space).
  • Suggestions keep filtering down as you keep typing letters — for example #a only shows ids starting with "a" — for every supported call: getElementById, getElementsByClassName, getElementsByTagName, getElementsByName, querySelector/querySelectorAll, and $()/jQuery().
  • # and . now behave exactly like plain text inside querySelector(", $(", and jQuery(" — suggestions work the same whether you're matching ids (#), classes (.), or typing a plain selector with nothing typed yet.

Notes / limitations

  • It only scans HTML files that are currently open as tabs in the same VS Code window (this keeps it simple and fast — no project-wide indexing).
  • Matching is done with a regex, not a full HTML parser, so extremely unusual markup could be missed.
  • Tag-name suggestions come from actual tags found in your open HTML, not a fixed list of standard HTML tags.

Feedback & Support

Found a bug or have an idea for a feature? Leave a review/rating on the Marketplace listing — feedback is very welcome and helps shape future updates.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft