質問編集履歴

2

参考の追加

2018/10/03 02:05

投稿

kuria
kuria

スコア12

test CHANGED
File without changes
test CHANGED
@@ -116,6 +116,10 @@
116
116
 
117
117
  ```
118
118
 
119
+ ```参考
120
+
121
+ https://qiita.com/nacasora/items/713919f7a56024f5c59f
122
+
119
123
 
120
124
 
121
125
  ### 詳細

1

html のソース記入

2018/10/03 02:04

投稿

kuria
kuria

スコア12

test CHANGED
File without changes
test CHANGED
@@ -40,6 +40,76 @@
40
40
 
41
41
  <button class="delete" onclick="deleteReply('${id}')">delete</button> </div>`
42
42
 
43
+ ```html
44
+
45
+ <script>
46
+
47
+ $(function () {
48
+
49
+ searchWord = function(){
50
+
51
+ var searchText = $(this).val(), // 検索ボックスに入力された値
52
+
53
+ targetText;
54
+
55
+
56
+
57
+ $('.target-area li').each(function() {
58
+
59
+ targetText = $(this).text();
60
+
61
+
62
+
63
+ if (targetText.indexOf(searchText) != -1) {
64
+
65
+ $(this).removeClass('hidden');
66
+
67
+ } else {
68
+
69
+ $(this).addClass('hidden');
70
+
71
+ }
72
+
73
+ });
74
+
75
+ };
76
+
77
+ </script>
78
+
79
+ </head>
80
+
81
+ <body>
82
+
83
+ <body>
84
+
85
+ <div class="wrapper">
86
+
87
+ <div class="search-area">
88
+
89
+ <form>
90
+
91
+ <input type="text" id="search-text" placeholder="検索ワードを入力">
92
+
93
+ </form>
94
+
95
+ <div class="search-result">
96
+
97
+ <div class="search-result__hit-num"></div>
98
+
99
+ <div id="search-result__list"></div>
100
+
101
+ </div>
102
+
103
+ </div>
104
+
105
+
106
+
107
+ <ul class="target-area">
108
+
109
+ <div id="replies"></div>
110
+
111
+ </div><!-- /.wrapper -->
112
+
43
113
  ```ここに言語名を入力
44
114
 
45
115
  html,javascript