-
Notifications
You must be signed in to change notification settings - Fork 0
/
hana no3.html
48 lines (48 loc) · 933 Bytes
/
hana no3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<head>
<title>Repo 1</title>
<script>
function ok(){
var a=document.getElementById("kar");
var b=document.getElementById("j").value;
var c=parseInt(b);
for(var i=1;i<=c;i++){
for(var k=1;k<=c;k++){
if(i==1 || i==c || k==1 || k==c){
cetak.innerHTML+=a.value;
}else{
cetak.innerHTML+=" ";
}
}cetak.innerHTML+="<br>"
}
}
function ref(){
window.location.reload();
}
</script>
</head>
<body style="font-family: Consolas;">
<p>Membuat Segiempat</p>
<table>
<tr>
<td>karakter</td>
<td><input type="text" id="kar"/></td>
</tr>
<tr>
<td>jumlah</td>
<td><input type="text" id="j"/></td>
</tr>
<tr>
<td></td>
<td><button onclick="ok()">ok</button></td>
</tr>
<td></td>
<td><button onclick="ref()">reset</button></td>
</tr>
<tr>
<td></td>
<td><label id="cetak" style="letter-spacing:10px;"></label></td>
</tr>
</table>
</body>
</html>