質問編集履歴
1
インデントを入れました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,23 +12,23 @@
|
|
12
12
|
|
13
13
|
```html
|
14
14
|
<p>
|
15
|
-
<input type="radio" class="demo1" name="demo1" id="demo1-1" autocomplete="off">
|
15
|
+
<input type="radio" class="demo1" name="demo1" id="demo1-1" autocomplete="off">
|
16
|
-
<label for="demo1-1">デモ1</label><br>
|
16
|
+
<label for="demo1-1">デモ1</label><br>
|
17
|
-
<input type="radio" class="demo1" name="demo1" id="demo1-2" autocomplete="off">
|
17
|
+
<input type="radio" class="demo1" name="demo1" id="demo1-2" autocomplete="off">
|
18
|
-
<label for="demo1-2">デモ2</label><br>
|
18
|
+
<label for="demo1-2">デモ2</label><br>
|
19
|
-
<input type="radio" class="demo1" name="demo1" id="demo1-3" autocomplete="off">
|
19
|
+
<input type="radio" class="demo1" name="demo1" id="demo1-3" autocomplete="off">
|
20
|
-
<label for="demo1-3">デモ3</label>
|
20
|
+
<label for="demo1-3">デモ3</label>
|
21
21
|
</p>
|
22
22
|
<p id="link1">ーー</p>
|
23
23
|
|
24
24
|
<p>
|
25
|
-
<input type="text" id="input1" autocomplete="off">
|
25
|
+
<input type="text" id="input1" autocomplete="off">
|
26
|
-
<input type="submit" id="submit1" value="送信">
|
26
|
+
<input type="submit" id="submit1" value="送信">
|
27
27
|
</p>
|
28
28
|
|
29
29
|
<p>
|
30
|
-
<textarea name="text2" id="text2" autocomplete="off"></textarea>
|
30
|
+
<textarea name="text2" id="text2" autocomplete="off"></textarea>
|
31
|
-
<input type="submit" id="submit2" value="送信">
|
31
|
+
<input type="submit" id="submit2" value="送信">
|
32
32
|
</p>
|
33
33
|
```
|
34
34
|
|
@@ -36,38 +36,38 @@
|
|
36
36
|
|
37
37
|
```js
|
38
38
|
$(function(){
|
39
|
-
$(".demo1").click(function(){
|
39
|
+
$(".demo1").click(function(){
|
40
|
-
if(this.checked){
|
40
|
+
if(this.checked){
|
41
|
-
$("#link1").html("<a href='#'>送信</a>");
|
41
|
+
$("#link1").html("<a href='#'>送信</a>");
|
42
|
-
} else {
|
42
|
+
} else {
|
43
|
-
$("#link1").html("Next");
|
43
|
+
$("#link1").html("Next");
|
44
|
-
};
|
44
|
+
};
|
45
|
+
});
|
45
46
|
});
|
46
|
-
});
|
47
47
|
|
48
48
|
$(function(){
|
49
|
-
if ($("#input1").val().length == 0) {
|
49
|
+
if ($("#input1").val().length == 0) {
|
50
|
-
$("#submit1").prop("disabled", true);
|
50
|
+
$("#submit1").prop("disabled", true);
|
51
|
-
}
|
51
|
+
}
|
52
|
-
$("#input1").on("keydown keyup keypress change", function() {
|
52
|
+
$("#input1").on("keydown keyup keypress change", function() {
|
53
|
-
if ($(this).val().length < 2) {
|
53
|
+
if ($(this).val().length < 2) {
|
54
|
-
$("#submit1").prop("disabled", true);
|
54
|
+
$("#submit1").prop("disabled", true);
|
55
|
-
} else {
|
55
|
+
} else {
|
56
|
-
$("#submit1").prop("disabled", false);
|
56
|
+
$("#submit1").prop("disabled", false);
|
57
|
-
}
|
57
|
+
}
|
58
|
+
});
|
58
59
|
});
|
59
|
-
});
|
60
60
|
|
61
61
|
$(function(){
|
62
|
-
if ($("#text2").val().length == 0) {
|
62
|
+
if ($("#text2").val().length == 0) {
|
63
|
-
$("#submit2").prop("disabled", true);
|
63
|
+
$("#submit2").prop("disabled", true);
|
64
|
-
}
|
64
|
+
}
|
65
|
-
$("#text2").on("keydown keyup keypress change", function() {
|
65
|
+
$("#text2").on("keydown keyup keypress change", function() {
|
66
|
-
if ($(this).val().length < 5) {
|
66
|
+
if ($(this).val().length < 5) {
|
67
|
-
$("#submit2").prop("disabled", true);
|
67
|
+
$("#submit2").prop("disabled", true);
|
68
|
-
} else {
|
68
|
+
} else {
|
69
|
-
$("#submit2").prop("disabled", false);
|
69
|
+
$("#submit2").prop("disabled", false);
|
70
|
-
}
|
70
|
+
}
|
71
|
+
});
|
71
72
|
});
|
72
|
-
});
|
73
73
|
```
|