P. 1
Java Script

Java Script

|Views: 1|Likes:
Published by Ferry Armansyah

More info:

Published by: Ferry Armansyah on Jun 04, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

06/04/2012

pdf

text

original

Faktorial <html> <head><title>Faktorial 01</title></head> <body> <h3 align="center">Tabel Faktorial</h3> <table align

="center" border="1" cellpadding="10" cellspacing="2" width="300"> <tr align="center" bgcolor="pink"><td>Faktorial</td><td>Hasil</td></tr> <script type="text/javascript"> var hsl=1; for(var i=1;i<=10;i++) { hsl*=i; document.write("<tr align='center'><td>"+i+" !</td><td>" +hsl+"</td></tr>"); } </script> </table> </body> </html> Table: tables_priv <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Table Structure</title> <style type="text/css"> th{ background-color:#FF9900; } </style> <script type="text/javascript"> function cek(bool) { for(var i=0;i<6;i++) document.frm.elements[i].checked=bool; } </script> </head> <body> <form name="frm"> <h2>Table: tables_priv</h2> <table> <tr> <th></th> <th>Field</th> <th>Type</th> </tr> <tr>

function mulai() { if(i==0) masukan=document.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html.txtMasukan. charset=iso-8859-1" /> <title>Teks Berjalan</title> <script type="text/javascript"> var i = 0.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.value. var clear = "".frm.0 Transitional//EN" "http://www. else masukan = clear.w3.<td><input type="checkbox" id="chk1" /></td> <td>Host</td> <td>char(60)</td> </tr> <tr> <td><input type="checkbox" id="chk2" /></td> <td>Db</td> <td>char(64)</td> </tr> <tr> <td><input type="checkbox" id="chk3" /></td> <td>User</td> <td>char(16)</td> </tr> <tr> <td><input type="checkbox" id="chk4" /></td> <td>Table Name</td> <td>char(64)</td> </tr> <tr> <td><input type="checkbox" id="chk5" /></td> <td>Grantor</td> <td>char(77)</td> </tr> <tr> <td><input type="checkbox" id="chk6" /></td> <td>Timestamp</td> <td>timestamp</td> </tr> <tr> <td colspan="3"><input type="button" value="Check All" onclick="cek(true)" /> / <input type="button" value="Uncheck All" onclick="cek(false)"/></td> </tr> </form> </table> </body> </html> Teks Berjalan dari Kanan Ke Kiri <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. .

dtd"> <html xmlns="http://www." /> </form> </div> </body> </html> Tanggal dan Waktu <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. } function berhenti() { clearTimeout(set). . kanan=masukan.substring(1."Kamis".org/TR/xhtml1/DTD/xhtml1-transitional."Senin"." /> <input type="button" name="btnStop" value="STOP" onclick="berhenti().w3. document."Rabu". jam().0 Transitional//EN" "http://www.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html. } function tanggal() { var hari=new Array("Minggu"."Sabtu"). } </script> </head> <body> <div align="center"> <form name="frm"> <h3>Teks Berjalan dari Kanan Ke Kiri</h3> <b>Input here</b><br/> <input type="text" name="txtMasukan" size="50" value=" "/><br/> <b>Output Here</b><br/> <input type="text" name="txtHasil" size="50" readonly="readonly"/><br/> <input type="button" name="btnStart" value="START" onclick="mulai(). clear = hasil."Jumat".charAt(0).masukan.txtHasil. charset=iso-8859-1" /> <title>Tanggal & Waktu Sistem</title> <script type="text/javascript"> function dateTime() { tanggal(). set = setTimeout('putarKanan(hasil)'. hasil=kanan+kiri.length).frm.1000).putarKanan(masukan).w3."Selasa". i++.value = hasil. } function putarKanan(masukan) { kiri=masukan.

getMinutes()+":"+objJam. document."Agustus".getSeconds()."Sept ember". } .org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html.1000).innerHTML=tgl."Oktober".getDate() + " " + bulan[objTgl.status="Waktu: " + wkt. color:#FF0000. var wkt=objJam.var bulan=new Array("Januari". objJam=setTimeout("jam()".innerHTML=wkt.getHours()+":"+objJam. window."Maret". } legend{ font-size:17px. var tgl=hari[objTgl.rataTengah{ text-align:center. var objTgl=new Date().getElementById("hari"). charset=iso-8859-1" /> <title>JavaScript String Object</title> <style type="text/css"> tr{ font:15px Verdana.0 Transitional//EN" "http://www."Desember"). } fieldset{ font-weight:500."November".getMonth()] + " " + objTgl. } </style> <script type="text/javascript"> function FOKUS() { .getElementById("wkt"). document.w3."Juli".getFullYear()."Mei"."Juni". text-align:left. color:#FF0000. } </script> </head> <body onload="dateTime()"> Hari: <span id="hari"></span><br/> Waktu: <span id="wkt"></span> </body> </html> String Object <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.w3.dtd"> <html xmlns="http://www."April". } function jam() { var objJam=new Date(). " + objTgl."Pebuari".org/TR/xhtml1/DTD/xhtml1-transitional.getDay()] + ".

value.forms[0]."> <tr class="rataTengah"> <td colspan="3"> <h2><u>JavaScript String Object</u></h2> </td> </tr> <tr class="rataTengah"> <td colspan="3"> Input String : <input type="text" size="80" name="txtMasukan" onkeyup="cekPanjang()" /> </td> </tr> <tr class="rataTengah"> .forms[0].txtPanjang.value=document. background-color:#FFFF99.forms[0].length).substring(s+cari. i++.forms[0].toUpper Case().toString().forms[0].txtMasukan.value.forms[0].forms[0].toStrin g().toS tring().value.forms[0]. } function cekPanjang(){ document.focus().txtMasukan. } function LowerCase(){ document.toLower Case(). var i=0. } function UpperCase(){ document.search(cari)!=-1) { s = masukan.txtMasukan.forms[0]. } document.s.txtMasukan." align="center"> <tr> <td> <table style="border:none #FF0000.document.txtCari.toString().txtFrk.length.txtSubs." padding:"5px 50px.txtMasukan.value=document.txtMasukan.search(cari).value.txtMasukan. } </script> </head> <body bgcolor="#FFFFCC" onload="FOKUS()"> <form> <table style="border:solid #FF9900. cekPanjang().value=i. while(masukan.forms[0].value. } function cariString() { var cari=document.value=document.txtMasukan. var masukan = document.forms[0]. masukan = masukan.value.forms[0].value=document. } function gantiTxtMasukan() { document.

<td colspan="3" style="color:#FF0000"> Panjang String : <input type="text" size="5" readonly="readonly" name="txtPanjang" /> </td> </tr> <tr valign="top"> <td> <fieldset> <legend>Ubah Bentuk Tulisan</legend> <input type="radio" name="rbtTulisan" onclick="UpperCase()" />Upper Case <br/> <input type="radio" name="rbtTulisan" onclick="LowerCase()" />Lower Case </fieldset> </td> <td> <fieldset> <legend>Find</legend> String Pencarian :<br/> <input type="text" name="txtCari" /><br/> Frekuensi Kemunculan : <br/> <input type="text" readonly="readonly" name="txtFrk" /><br/> <input type="button" value="Cari" name="btnCari" onclick="cariString()" /> </fieldset> </td> <td> <fieldset> <legend>Replace</legend> String Substitusi: <br/> <input type="text" name="txtSubs" /><br/> <input type="button" value="Ganti" name="btnGanti" onclick="gantiTxtMasukan()" /> </fieldset> </td> </tr> </table> </td> </tr> </table> </form> </body> </html> .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->