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
Open the Extensions view in VS Code (Ctrl+Shift+X / Cmd+Shift+X).
Search for "HTML Attribute IntelliSense".
Click Install.
Once installed, it's active automatically for JS/TS/JSX/TSX files — no
setup needed.
Usage
Open your .html file in a tab (it just needs to be open — doesn't need to be active).
Open your .js file.
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").
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.