回答編集履歴

1

間違っていたので修正

2017/06/22 13:16

投稿

mattn
mattn

スコア5030

test CHANGED
@@ -4,9 +4,15 @@
4
4
 
5
5
  $(function() {
6
6
 
7
- $('.name span').remove()
7
+ $('.name').contents().filter(function() {
8
8
 
9
+ // 3: TextNode
10
+
11
+ return this.nodeType !== 3 && this.nodeName.toUpperCase() !== 'BR';
12
+
13
+ }).remove();
14
+
9
- });
15
+ })();
10
16
 
11
17
  </script>
12
18