回答編集履歴
3
さらに正規表現を修正しました。
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
```js
|
10
10
|
|
11
|
-
$("#txtara2").val($("#txtara1").val().replace(/\s+(id
|
11
|
+
$("#txtara2").val($("#txtara1").val().replace(/\s+(id|class)=".*?"/g,""));
|
12
12
|
|
13
13
|
```
|
14
14
|
|
2
修正2
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
```js
|
10
10
|
|
11
|
-
$("#txtara2").val($("#txtara1").val().replace(/\s
|
11
|
+
$("#txtara2").val($("#txtara1").val().replace(/\s+(id=".*?"|class=".*?")/g,""));
|
12
12
|
|
13
13
|
```
|
14
14
|
|
1
正規表現が誤っていたので修正しました。
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
```js
|
10
10
|
|
11
|
-
$("#txtara2").val($("#txtara1").val().replace(/\s*(id=".*"|class=".*")/g,""));
|
11
|
+
$("#txtara2").val($("#txtara1").val().replace(/\s*(id=".*?"|class=".*?")/g,""));
|
12
12
|
|
13
13
|
```
|
14
14
|
|