/
Attr.cljs
93 lines (64 loc) · 2.28 KB
/
Attr.cljs
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
(ns web.Attr
"This type represents a DOM element's attribute as an object.
most DOM methods, you will probably directly retrieve the attribute
a string (e.g., `Element.getAttribute()`, but certain functions
`Element.getAttributeNode()`) or means of iterating give Attr"
(:refer-clojure :exclude [name]))
(defn name
"Property.
The attribute's name."
[this]
(-> this (.name)))
(defn set-name!
"Property.
The attribute's name."
[this val]
(aset this "name" val))
(defn local-name
"Property.
The Attr.localName read-only property returns the local part
the qualified name of an element.
`name = attribute.localName`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Attr/localName`"
[this]
(-> this (.localName)))
(defn set-local-name!
"Property.
The Attr.localName read-only property returns the local part
the qualified name of an element.
`name = attribute.localName`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Attr/localName`"
[this val]
(aset this "localName" val))
(defn namespace-uri
"Property.
The Attr.namespaceURI read-only property returns the namespace
of the attribute, or null if the element is not in a namespace.
`namespace = attribute.namespaceURI`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Attr/namespaceURI`"
[this]
(-> this (.namespaceURI)))
(defn set-namespace-uri!
"Property.
The Attr.namespaceURI read-only property returns the namespace
of the attribute, or null if the element is not in a namespace.
`namespace = attribute.namespaceURI`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Attr/namespaceURI`"
[this val]
(aset this "namespaceURI" val))
(defn prefix
"Property.
The Attr.prefix read-only property returns the namespace prefix
the specified attribute, or null if no prefix is specified.
`string = attribute.prefix`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Attr/prefix`"
[this]
(-> this (.prefix)))
(defn set-prefix!
"Property.
The Attr.prefix read-only property returns the namespace prefix
the specified attribute, or null if no prefix is specified.
`string = attribute.prefix`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Attr/prefix`"
[this val]
(aset this "prefix" val))