-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
64 lines (51 loc) · 1.39 KB
/
index.html
File metadata and controls
64 lines (51 loc) · 1.39 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body{
margin: 0;
padding: 0;
}
button{
margin: 20px;
}
.no-margin{
margin: 0;
}
.red{
color: red;
}
</style>
</head>
<body>
hello world!
<button class="red">hello</button>
<input class="txt" type="text" />
<script src="tethys.min.js"></script>
<script>
$('button').on('click', function(e){
$('body').css({
'background-color': 'green'
}).css('font-size', '22px');
console.log($('body').css('background-color'));
console.log('hasClass red ' + $(this).hasClass('red'));
$(this).addClass('no-margin').removeClass('red');
console.log('hasClass red ' + $(this).hasClass('red'));
$(this).attr('name', 'hap').attr({
age: 18
});
console.log($(this).attr('name'));
$(document.body).append('<a href="#">append a link</a>');
});
var eventName = 'click'
$('input').on(eventName, function(){
this.value = Math.random();
});
setTimeout(function(){
$('input').trigger(eventName);
}, 2000);
</script>
</body>
</html>