質問編集履歴
1
HTMLを追加しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,6 +3,34 @@
|
|
3
3
|
フォームを部分的にリセットしたくて、
|
4
4
|
以下のようなjQueryを追加しました。
|
5
5
|
|
6
|
+
```HTML
|
7
|
+
<form action="/" method="POST">
|
8
|
+
<div id="form1">
|
9
|
+
<input type="text">
|
10
|
+
<label>
|
11
|
+
<input type="radio" value="ラジオ1">ラジオ1
|
12
|
+
</label>
|
13
|
+
<label>
|
14
|
+
<input type="radio" value="ラジオ2">ラジオ2
|
15
|
+
</label>
|
16
|
+
</div>
|
17
|
+
<button id="form1_reset">入力内容をクリア</button>
|
18
|
+
<div id="form2">
|
19
|
+
<input type="text">
|
20
|
+
<label>
|
21
|
+
<input type="check" value="チェックボックス1">チェックボックス1
|
22
|
+
</label>
|
23
|
+
<label>
|
24
|
+
<input type="check" value="チェックボックス2">チェックボックス2
|
25
|
+
</label>
|
26
|
+
</div>
|
27
|
+
<button id="form2_reset">入力内容をクリア</button>
|
28
|
+
・
|
29
|
+
・
|
30
|
+
・
|
31
|
+
</form>
|
32
|
+
```
|
33
|
+
|
6
34
|
```jQuery
|
7
35
|
$(function () {
|
8
36
|
$('#form1_reset').click( function() {
|