質問編集履歴

4

html追記しました

2019/01/23 01:54

投稿

mei666
mei666

スコア15

test CHANGED
File without changes
test CHANGED
@@ -9,6 +9,48 @@
9
9
 
10
10
 
11
11
  ```html
12
+
13
+ <!DOCTYPE html>
14
+
15
+ <html lang="ja">
16
+
17
+ <head>
18
+
19
+ <title>Q and A</title>
20
+
21
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge">
22
+
23
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
24
+
25
+ <meta http-equiv="Content-Style-Type" content="text/css">
26
+
27
+ <link rel="stylesheet" type="text/css" href="style.css">
28
+
29
+ <link rel="stylesheet" type="text/css" href="css/css_qa.css">
30
+
31
+ <script type="text/javascript" src="http://code.jquery.com/jquery-2.2.3.min.js"></script>
32
+
33
+ <script src="js/jjquery.quicksearch1.js" type="text/javascript">
34
+
35
+ </script>
36
+
37
+
38
+
39
+ </head>
40
+
41
+ <body>
42
+
43
+ <div id="contents">
44
+
45
+ <div id="main">
46
+
47
+
48
+
49
+ <p> <input type="text" id="search" value=" "> <input type="button" value="and検索" id="button2" id="btn-onoff"> <input type="button" value="すべて表示" id="button3">
50
+
51
+ <label><input type="checkbox" id="check1">ハイライト</label>
52
+
53
+
12
54
 
13
55
 
14
56
 
@@ -61,6 +103,8 @@
61
103
  </div>
62
104
 
63
105
  </div>
106
+
107
+ </body>
64
108
 
65
109
  ```
66
110
 

3

タグ修正しました

2019/01/23 01:54

投稿

mei666
mei666

スコア15

test CHANGED
File without changes
test CHANGED
@@ -34,11 +34,11 @@
34
34
 
35
35
  <input id="cp_tabfour012" type="checkbox" name="tabs">
36
36
 
37
- <label for="cp_tabfour012"><tr><td>Q:ああbb</label>
37
+ <label for="cp_tabfour012">Q:ああbb</label>
38
38
 
39
39
  <div class="cp_actab-content">
40
40
 
41
- <p>A:ううううう</p></tr>
41
+ <p>A:ううううう</p>
42
42
 
43
43
  </div>
44
44
 
@@ -50,7 +50,7 @@
50
50
 
51
51
  <label for="cp_tabfour013">Q:いいいいcc</label>
52
52
 
53
- <div class="cp_actab-content"><tr>
53
+ <div class="cp_actab-content">
54
54
 
55
55
  <p>A:ええええええ</p>
56
56
 

2

Tableタグをdivにおきかえてみました

2019/01/22 08:07

投稿

mei666
mei666

スコア15

test CHANGED
File without changes
test CHANGED
@@ -121,3 +121,5 @@
121
121
  });
122
122
 
123
123
  });
124
+
125
+ ```

1

Tableタグをdivに修正してみました

2019/01/22 05:03

投稿

mei666
mei666

スコア15

test CHANGED
File without changes
test CHANGED
@@ -74,9 +74,9 @@
74
74
 
75
75
  var re = new RegExp($('#search').val().trim().replace(/ +/, "|"));
76
76
 
77
- $('#result tbody tr').each(function() {
77
+ $('div.cp_actab').each(function() {
78
78
 
79
- $(this).toggle($(this).find('td').filter(function() {
79
+ $(this).toggle($(this).find('p,label').filter(function() {
80
80
 
81
81
  return $(this).text().match(re) ? true : false;
82
82
 
@@ -88,7 +88,7 @@
88
88
 
89
89
  $('#button2').on("click", function() {
90
90
 
91
- $('#result tbody tr').each(function() {
91
+ $('div.cp_actab').each(function() {
92
92
 
93
93
  var tr = $(this);
94
94
 
@@ -96,7 +96,7 @@
96
96
 
97
97
  var flg = re.map(function(x) {
98
98
 
99
- return tr.has($('td').filter(function() {
99
+ return div.has($('div').filter(function() {
100
100
 
101
101
  return $(this).text().match(new RegExp(x));
102
102
 
@@ -108,7 +108,7 @@
108
108
 
109
109
  }).length == re.length;
110
110
 
111
- tr.toggle(flg);
111
+ div.toggle(flg);
112
112
 
113
113
  });
114
114
 
@@ -116,10 +116,8 @@
116
116
 
117
117
  $('#button3').on("click", function() {
118
118
 
119
- $('#result tr').show();
119
+ $('$('div.cp_actab').show();
120
120
 
121
121
  });
122
122
 
123
123
  });
124
-
125
- ```