Belajar tentang web
Senin, 18 Januari 2016
TUGAS LOOPING
CONTOH PROGRAMNYA
<html>
<head>
<title> loop2 </title>
<script>
function tampil()
{
var n, i;
n=document.getElementById("txtn").value;
for (i=1; i<=n; i++)
{
document.write(i+".fikom unika <br>");
}
}
</script>
</head>
<body>
<form>
INPUT N
<input type="TEXT" size="5" NAME="txtn" id="txtn">
<input type="BUTTON" value="PROSES" onclick="tampil()">
</form>
</body>
</html>
Tugas Radio Button
CONTOH CODING NYA
<html>
<head>
<title>contoh penggunaan formulir</title>
</head>
<body>
<table border=1>
<tr><td>
<form>
Jenis kelamin:<br>
<input type = "RADIO"
name = "sex" CHECKED>pria<br>
<input type = "RADIO"
name = "sex">wanita<br>
<br>
komentar anda:<br>
<TEXTAREA name = "komentar"
rows =5" COLS = "40" wrap>
</TEXTAREA>
</table>
</form>
</body>
</html>
MEMBUAT IKLAN
CONTOH PROGRAMNYA
<html>
<head>
<title></title>
</head>
<body onload="tampil()">
<script>
function tampil()
{
var mywindow1=window.open("","","width=250, height=300px,location=no,risizeable=n-resize, dialog=2");
mywindow1.document.write("masukan iklan anda");
var atr
atr="<html><head><title>My window</title><style>h1{font-size:200px;}</style></head><body bgcolor=yellow><h1>1</h1></body></html>";
mywindow1.document.write(atr);
var mywindow2=window.open("","","width=250, height=300px,left=1360px,location=no,risizeable=n-resize, dialog=1");
mywindow2.document.write("window buatanku");
atr="<html><head><title>My window</title></head><body bgcolor=aqua></html>";
mywindow2.document.write(atr);
var mywindow3=window.open("","","width=250, height=300px,top=850px,left=1360px,location=no,risizeable=n-resize, dialog=3");
mywindow3.document.write("window buatanku");
atr="<html><head><title>My window</title></head><body bgcolor=green></body></html>";
mywindow3.document.write(atr);
var mywindow4=window.open("","","width=250, height=300px,top=850px,location=no,risizeable=n-resize, dialog=4");
mywindow4.document.write("window buatanku");
atr="<html><head><title>My window</title></head><body bgcolor=pink></body></html>";
mywindow4.document.write(atr);
}
</script>
</body>
</html>
<head>
<title></title>
</head>
<body onload="tampil()">
<script>
function tampil()
{
var mywindow1=window.open("","","width=250, height=300px,location=no,risizeable=n-resize, dialog=2");
mywindow1.document.write("masukan iklan anda");
var atr
atr="<html><head><title>My window</title><style>h1{font-size:200px;}</style></head><body bgcolor=yellow><h1>1</h1></body></html>";
mywindow1.document.write(atr);
var mywindow2=window.open("","","width=250, height=300px,left=1360px,location=no,risizeable=n-resize, dialog=1");
mywindow2.document.write("window buatanku");
atr="<html><head><title>My window</title></head><body bgcolor=aqua></html>";
mywindow2.document.write(atr);
var mywindow3=window.open("","","width=250, height=300px,top=850px,left=1360px,location=no,risizeable=n-resize, dialog=3");
mywindow3.document.write("window buatanku");
atr="<html><head><title>My window</title></head><body bgcolor=green></body></html>";
mywindow3.document.write(atr);
var mywindow4=window.open("","","width=250, height=300px,top=850px,location=no,risizeable=n-resize, dialog=4");
mywindow4.document.write("window buatanku");
atr="<html><head><title>My window</title></head><body bgcolor=pink></body></html>";
mywindow4.document.write(atr);
}
</script>
</body>
</html>
Langganan:
Postingan (Atom)