kelo

Форк
0
/
element.go 
54 строки · 1.0 Кб
1
package godom
2

3
import "gitverse.ru/metalcore/kelo/wrapper"
4

5
type ElementValuer interface {
6
	NodeValuer
7

8
	ClassName() string
9
	SetClassName(string) ElementValuer
10
	Id() string
11
	SetId(id string) ElementValuer
12
	InnerHTML() string
13
	SetInnerHTML(string) ElementValuer
14
	TagName() string
15
}
16

17
type Element struct {
18
	Node
19
}
20

21
func NewElement(v wrapper.JSValuer) *Element {
22
	return &Element{*NewNode(v)}
23
}
24

25
func (e *Element) ClassName() string {
26
	return e.GetJS().Get("className").String()
27
}
28

29
func (e *Element) SetClassName(className string) ElementValuer {
30
	e.GetJS().Set("className", className)
31
	return e
32
}
33

34
func (e *Element) Id() string {
35
	return e.GetJS().Get("id").String()
36
}
37

38
func (e *Element) SetId(id string) ElementValuer {
39
	e.GetJS().Set("id", id)
40
	return e
41
}
42

43
func (e *Element) InnerHTML() string {
44
	return e.GetJS().Get("className").String()
45
}
46

47
func (e *Element) SetInnerHTML(innerHTML string) ElementValuer {
48
	e.GetJS().Set("innerHTML", innerHTML)
49
	return e
50
}
51

52
func (e *Element) TagName() string {
53
	return e.GetJS().Get("tagName").String()
54
}
55

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.