Contoh Latihan membuat program sederhana dengan menggunakan Windows method
<html>
<head>
<title>latihan window1</title>
<script language="javascript">
function create()
{
a=document.forms['form1'].lebar.value;
b=document.forms['form1'].tinggi.value;
c=document.forms['form1'].tb.value;
d=document.forms['form1'].st.value;
e=document.forms['form1'].mn.value;
f=document.forms['form1'].scrol.value;
g=document.forms['form1'].uk.value;
tampilkan="width= "+a +",height= "+b +",toolbar= "+c +",status= "+d+",menubar= "+e+",scrollbars= "+f+",resizeable= "+g;
myWindow=window.open("","Mywindow",tampilkan);
wyWindow.document.write("Ini Website Yang Anda buat.");
wyWindow.document.close;
}
</script>
</head>
<body bgcolor="#FFFFFF"> <font face="trebuchet ms">
<font color="#AED2FB">
<h1 align="center"> Welcome!</h1>
<p align="justify">
Selamat datang di website kami. Pada website ini anda bisa menentukan sendiri tampilan browser sesuai dengan apa yang anda inginkan.
Isi pada textbox yang tersedia berikut.</p></font>
<form name="form1">
<table width="100%">
<tr>
<td> Width </td>
<td> <input type="text" name="lebar"/><font color="#DDDDDD"> 0-1000</font></td>
</tr>
<tr>
<td> Height </td>
<td> <input type="text" name="tinggi" /><font color="#DDDDDD"> 0-1000</font></td>
</tr>
<tr>
<td> Toolbar </td>
<td> <input type="text" name="tb" /><font color="#DDDDDD"> 0=No,1=Yes</font></td>
</tr>
<tr>
<td> Status </td>
<td> <input type="text" name="st" /><font color="#DDDDDD"> 0=No,1=Yes</font></td>
</tr>
<tr>
<td> Menubar </td>
<td> <input type="text" name="mn" /><font color="#DDDDDD"> 0=No,1=Yes</font></td>
</tr>
<tr>
<td> Scrollbars </td>
<td> <input type="text" name="scrol" /><font color="#DDDDDD"> 0=No,1=Yes</font></td>
</tr>
<tr>
<td> Resizeable </td>
<td> <input type="text" name="uk" /><font color="#DDDDDD"> 0=No,1=Yes</font></td>
</tr>
<tr>
<td colspan="2"> <input type="button" value="Create My Window" onClick="create()"></td>
</tr>
<tr>
<td colspan="2"> © By Agustina 081101699 2010</td>
</tr></table>
</form>
</font>
</body>
</html>
No comments:
Post a Comment