Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>DOM Code SnippetsNew to Visual Studio Code? Get it now.
DOM Code Snippets

DOM Code Snippets

Yongze Yao

|
46,194 installs
| (2) | Free
Code Snippets for getting / creating DOM elements.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DOM Code Snippets

Features

This extension contains a set of code snippets for getting / creating DOM elements.


Installation

In order to install an extension you need to go to the extension tab or launch the Command Palette (Ctrl + Shift + P or Cmd + Shift + P) and type Extensions.

There you have either the option to show the already installed snippets or install new ones. Search for DOM Code Snippets and install it.


Supported languages (file extensions)

  • JavaScript (.js)
  • TypeScript (.ts)
  • Vue (.vue)
  • JavaScript React (.jsx)
  • TypeScript React (.tsx)

Snippets

Below is a list of all snippets. The → means the TAB key.

Getting elements

Trigger Content
gid→ const var = document.getElementById('id')
dqs→ const var = document.querySelector('selector');
dqa→ const var = document.querySelectorAll('selector');
dce→ const var = document.createElement('element');

Future plan

As soon as I find myself needing a new snippet, I will add it to this extension.

Also, any suggestion is welcomed!

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