This extension contains a set of code snippets for getting / creating DOM elements.
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.
- JavaScript (.js)
- TypeScript (.ts)
- Vue (.vue)
- JavaScript React (.jsx)
- TypeScript React (.tsx)
Below is a list of all snippets. The → means the TAB
key.
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'); |
As soon as I find myself needing a new snippet, I will add it to this extension.
Also, any suggestion is welcomed!