-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestJQuery.html
More file actions
55 lines (54 loc) · 1.26 KB
/
Copy pathtestJQuery.html
File metadata and controls
55 lines (54 loc) · 1.26 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery入門</title>
</head>
<body>
<h1>jQueryを書いてみよう!</h1>
<p>jQueryは、世界中でよく使用される、ライブラリのひとつです。</p>
<p>jQueryの歴史は古く....</p
<h2>リスト1</h2>
<ul id="list1" class="unordered">
<li>リスト</li>
<li>リスト</li>
<li>リスト</li>
</ul>
<h2>リスト2</h2>
<ol id="list2" class="ordered">
<li>リスト</li>
<li>リスト</li>
<li>リスト</li>
</ol>
<table>
<tr>
<th>項目1</th>
<th>項目2</th>
<th>項目3</th>
</tr>
<tr>
<td>リスト</td>
<td>リスト</td>
<td>リスト</td>
</tr>
<tr>
<td>リスト</td>
<td>リスト</td>
<td>リスト</td>
</tr>
</table>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script>
$(function() {
$('table').find('td').data('count',0)
.on('click',function(){
const $this = $(this);
let number = $this.data('count')+1;
$this
.data('count',number)
.text(number);
});
});
</script>
</body>
</html>