回答編集履歴
2
ちょうせい
answer
CHANGED
@@ -22,7 +22,6 @@
|
|
22
22
|
var a=$(this).find('p').map(function(){
|
23
23
|
return $(this).text();
|
24
24
|
}).get();
|
25
|
-
console.log(a.join(String.fromCharCode(13)));
|
26
25
|
$(this).closest('.filter_image').toggle(new RegExp(text).test(a.join(String.fromCharCode(10))));
|
27
26
|
});
|
28
27
|
});
|
1
ちょうせい
answer
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# 完全一致
|
1
2
|
```javascript
|
2
3
|
$(function(){
|
3
4
|
$(".input_text").on("input",function(event){
|
@@ -10,4 +11,20 @@
|
|
10
11
|
});
|
11
12
|
});
|
12
13
|
});
|
14
|
+
```
|
15
|
+
|
16
|
+
# 部分一致
|
17
|
+
```javascript
|
18
|
+
$(function(){
|
19
|
+
$(".input_text").on("input",function(event){
|
20
|
+
let text=$(this).val();
|
21
|
+
$('.keyword_list').each(function(){
|
22
|
+
var a=$(this).find('p').map(function(){
|
23
|
+
return $(this).text();
|
24
|
+
}).get();
|
25
|
+
console.log(a.join(String.fromCharCode(13)));
|
26
|
+
$(this).closest('.filter_image').toggle(new RegExp(text).test(a.join(String.fromCharCode(10))));
|
27
|
+
});
|
28
|
+
});
|
29
|
+
});
|
13
30
|
```
|