質問編集履歴
2
さらに追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -196,4 +196,13 @@
|
|
196
196
|
<noscript>none javascript...</noscript>
|
197
197
|
</body>
|
198
198
|
</html>
|
199
|
-
```
|
199
|
+
```
|
200
|
+
|
201
|
+
|
202
|
+
さらに追記
|
203
|
+
---
|
204
|
+
すみません、言い方に間違いがあったみたいでした。
|
205
|
+
```n=Math.floor(Math.random()*col.length);```
|
206
|
+
で変更処理をしようとしています、ができません。
|
207
|
+
|
208
|
+
<body>内から<head>内に移動させたのも間違いでしょうか?
|
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
練習ですので内容は適当です。
|
8
8
|
ご指摘お願いますm(..)m
|
9
9
|
|
10
|
-
```
|
10
|
+
```html
|
11
11
|
<!DOCTYPE html>
|
12
12
|
<html lang="ja">
|
13
13
|
<head>
|
@@ -84,4 +84,116 @@
|
|
84
84
|
<noscript>none javascript...</noscript>
|
85
85
|
</body>
|
86
86
|
</html>
|
87
|
+
```
|
88
|
+
|
89
|
+
追記
|
90
|
+
---
|
91
|
+
このソースでの挙動を確認したいのが、
|
92
|
+
・背景色の変更
|
93
|
+
・更新ごとに背景色の変更されていくこと
|
94
|
+
です。
|
95
|
+
|
96
|
+
いろいろさわる前は上記2つは確認できたのですが、
|
97
|
+
さわることで確認できなくなってしまい、、
|
98
|
+
ちなみにこれの少し前の確認できるものがこれです。
|
99
|
+
```html
|
100
|
+
<!DOCTYPE html>
|
101
|
+
<html lang="ja">
|
102
|
+
<head>
|
103
|
+
<meta charset="UTF-8">
|
104
|
+
<meta http-equiv="Content-Script-Type">
|
105
|
+
<title>Document</title>
|
106
|
+
</head>
|
107
|
+
<body onload="defaultStatus='color'">
|
108
|
+
<input type="button" value="ボタン" onclick="document.bgColor='blue';" ondblclick="document.bgColor='#ccc';"><br>
|
109
|
+
<form action="" method="get" accept-charset="utf-8" name="form1" onsubmit="return check()">
|
110
|
+
<input type="text" name="name"><br>
|
111
|
+
<input type="submit" name="送信"><br>
|
112
|
+
</form>
|
113
|
+
<script>
|
114
|
+
<!--
|
115
|
+
function check() {
|
116
|
+
for ( i = 0; i < document.form1.length; i++) {
|
117
|
+
if (document.form1.elements[i].value == "") {
|
118
|
+
alert("全部入力してください");
|
119
|
+
return false;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
return true;
|
123
|
+
}
|
124
|
+
document.forms[0].length;
|
125
|
+
document.fgColor="black";
|
126
|
+
col=new Array();
|
127
|
+
col[0]="red";
|
128
|
+
col[1]="blue";
|
129
|
+
col[2]="yellow";
|
130
|
+
col[3]="green";
|
131
|
+
col[4]="gray";
|
132
|
+
n=Math.floor(Math.random()*col.length);
|
133
|
+
document.bgColor=col[n];
|
134
|
+
// setInterval("document.bgColor=col[n];",1000);
|
135
|
+
// confirm("ダウンロードしますか?");
|
136
|
+
// prompt("お名前は?","しおり");
|
137
|
+
// window.open("https://www.google.co.jp/","new","toolbar=1");
|
138
|
+
/*
|
139
|
+
fuku=window.prompt("福引");
|
140
|
+
switch(fuku){
|
141
|
+
case "7":
|
142
|
+
document.write("おめでとう");
|
143
|
+
break;
|
144
|
+
case "5":case "2":
|
145
|
+
document.write("おしい");
|
146
|
+
break;
|
147
|
+
default:
|
148
|
+
document.write("はずれ");
|
149
|
+
break;
|
150
|
+
}
|
151
|
+
*/
|
152
|
+
b=new Array(1,2,3);
|
153
|
+
document.write(b[0]+b[2],"<br>");
|
154
|
+
document.write("ドメインは",document.domain,"<br>");
|
155
|
+
document.write("タイトルは",document.title,"<br>");
|
156
|
+
document.write("最終更新は",document.lastModified,"<br>");
|
157
|
+
x = 5;
|
158
|
+
a="aa11";
|
159
|
+
num=parseInt(a);
|
160
|
+
document.write(num);
|
161
|
+
document.write((b=6)+1);
|
162
|
+
point=90;
|
163
|
+
result=(point>75)?"合格 ":"不合格 ";
|
164
|
+
document.write(result);
|
165
|
+
document.write(100/0);
|
166
|
+
dd=new Date();
|
167
|
+
seconds=dd.getSeconds();
|
168
|
+
if (seconds%3==0) {
|
169
|
+
document.write("3で割り切れます。");
|
170
|
+
} else if (seconds%2==0) {
|
171
|
+
document.write("偶数秒です。");
|
172
|
+
} else {
|
173
|
+
document.write("どちらでもないです。");
|
174
|
+
}
|
175
|
+
w=1;
|
176
|
+
while(w<5){
|
177
|
+
document.write("<br>",w);
|
178
|
+
w++;
|
179
|
+
}
|
180
|
+
for ( i = 1; i <= 5; i++) {
|
181
|
+
document.write("<br>こんにちは");
|
182
|
+
}
|
183
|
+
for ( j = 1; j <= 9; j++) {
|
184
|
+
document.write("<br>",j,"の位<br>");
|
185
|
+
for ( i = 1; i <= 9; i++) {
|
186
|
+
document.write(j,"*",i,"=",j*i,"<br>");
|
187
|
+
}
|
188
|
+
}
|
189
|
+
//-->
|
190
|
+
</script>
|
191
|
+
<br>
|
192
|
+
<form action="" method="get" accept-charset="utf-8" name="form1" onsubmit="return check()">
|
193
|
+
<input type="text" name="name"><br>
|
194
|
+
<input type="submit" name="送信"><br>
|
195
|
+
</form>
|
196
|
+
<noscript>none javascript...</noscript>
|
197
|
+
</body>
|
198
|
+
</html>
|
87
199
|
```
|