This repository was archived by the owner on Sep 23, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdom.cson
56 lines (56 loc) · 1.7 KB
/
dom.cson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
".source.js":
"addEventListener":
prefix: "ae"
body: """
${1:document}.addEventListener('${2:event}', ${3:ev} => {
\t${0}
})
"""
"removeEventListener":
"prefix": "rel"
"body": "${1:document}.removeEventListener('${2:event}', ${3:listener})"
"getElementById":
"prefix": "gi"
"body": "${1:document}.getElementById('${2:id}')"
"getElementsByClassName":
"prefix": "gc"
"body": "Array.from(${1:document}.getElementsByClassName('${2:class}'))"
"getElementsByTagName":
"prefix": "gt"
"body": "Array.from(${1:document}.getElementsByTagName('${2:tag}'))"
"querySelector":
"prefix": "qs"
"body": "${1:document}.querySelector('${2:selector}')"
"querySelectorAll":
"prefix": "qsa"
"body": "Array.from(${1:document}.querySelectorAll('${2:selector}'))"
"createDocumentFragment":
"prefix": "cdf"
"body": "${1:document}.createDocumentFragment(${2:elem})"
"createElement":
"prefix": "cel"
"body": "${1:document}.createElement(${2:elem})"
"classList.add":
"prefix": "cla"
"body": "${1:el}.classList.add('${2:class}')"
"classList.remove":
"prefix": "cr"
"body": "${1:el}.classList.remove('${2:class}')"
"classList.toggle":
"prefix": "ct"
"body": "${1:el}.classList.toggle('${2:class}')"
"getAttribute":
"prefix": "ga"
"body": "${1:el}.getAttribute('${2:attr}')"
"removeAttribute":
"prefix": "ra"
"body": "${1:el}.removeAttribute('${2:attr}')"
"setAttribute":
"prefix": "sa"
"body": "${1:el}.setAttribute('${2:attr}', ${3:value})"
"appendChild":
"prefix": "ac"
"body": "${1:el}.appendChild(${2:elem})"
"removeChild":
"prefix": "rc"
"body": "${1:el}.removeChild(${2:elem})"