/
jquery_exercises.html
90 lines (86 loc) · 3.21 KB
/
jquery_exercises.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Kulim+Park|Noto+Sans+JP&display=swap" rel="stylesheet">
<title>jQuery exercises</title>
<style>
/*.newFont {*/
/* font-family: 'Kulim Park', sans-serif;*/
/*}*/
/*.otherFont {*/
/* font-family: 'Noto Sans JP', sans-serif;*/
/*}*/
/*.greenText {*/
/* color: green;*/
/*}*/
/*.codeup {*/
/* border: 1px solid red;*/
/*}*/
</style>
</head>
<body>
<h1 id="title" class="codeup">Happy New Year!</h1>
<ul id="resolutions" class="resList">
<li id="li1" class="odd">this</li>
<li id="li2" class="even">that</li>
<li id="li3" class="odd">and</li>
<li id="li4" class="even">the</li>
<li id="li5" class="odd">other</li>
</ul>
<p id="intro" class="codeup">Welcome to 2020, hope you have a good year! Lorem ipsum dolor sit amet, consectetur adipisicing elit. A consectetur doloribus laborum nostrum nulla quisquam? Assumenda doloremque exercitationem molestiae necessitatibus?</p>
<form action="" name="resForm">
<div id="form" class="codeup">
<label for="goal">what do you want to do this year?</label>
<input id="goal" name="goal" type="text">
</div>
</form>
<button id="button" class="cyan">Click Me!</button>
<!--<script src="/js/jquery-2.2.4.js"></script>-->
<!--<script src="/js/jquery.js"></script>-->
<!--<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>-->
<!--<script-->
<!-- src="https://code.jquery.com/jquery-2.2.4.js"-->
<!-- integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="-->
<!-- crossorigin="anonymous">
</script>-->
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script>
(function () {
"use strict";
$(document).ready(function () {
//mouse events exercise//
$('h1').click(function () {
$(this).css('background-color', blue');
});
$('p').dblclick(function () {
$(this).css('font-size', '18px');
});
$('li').hover(
function () {
$('li').css('color', 'red')
},
function () {
$('li').css('color', 'black')
}
);
//jquery exercise//
// // alert ($("#button").html());
// // alert ($("#resolutions").html());
// // $('.codeup').css('border', '1px solid red');
// $('li').css('font-size', '20px');
// $('h1, p, li').css('background-color', 'yellow');
// alert ($('h1').html());
// $(".codeup").addClass('greenText').hover(function () {
// console.log('hover over');
// }, function () {
// console.log('hover out');
// })
})
})();
</script>
</body>
</html>