membuat kalkulator sederhana menggunakan HTML



<html>
<head>
<title>Kalkulator Online</title>
<script>
function hitung(angka1,angka2,operator)
{
var hasil;
if (operator==”tambah”){
hasil = parseInt(angka1) + parseInt(angka2);
}else if(operator==”kurang”){
hasil = parseInt(angka1) – parseInt(angka2);
}else if(operator==”kali”){
hasil = parseInt(angka1) * parseInt(angka2);
}else if(operator==”bagi”){
hasil = parseInt(angka1) / parseInt(angka2);
}
document.getElementById(“hasil”).innerHTML = “<b>” +hasil+ “</b>”;
return false;
}
</script>
</head>
<body>
<form name=”form1″ method=”post” action=”hitung.php” onsubmit=”return hitung
(form1.angka.value,form1.angka2.value,form1.operator.value);”>
<table align=”center” width=”28%” border=”5″ bgcolor=”lime”>
<tr>
<td align=”center”>
<h1><center><u>Online Calculator</u></center></h1>
<h3>
Bilangan 1<input name=”angka” type=”text” id=”angka”><br>
<center><select name=”operator” id=”operator”>
<option value=”tambah”>+</option>
<option value=”kurang”>-</option>
<option value=”kali”>*</option>
<option value=”bagi”>/</option>
</select></center>Bilangan 2<input name=”angka2″ type=”text” id=”angka2″><br>
<center><input type=”submit” name=”Submit” value=”Hitung”></center><div style=”float:left;”>- Hasil :</div><br>
<div id=”hasil”></div>
</h3>
<marquee><h6>Kalkulator Online dengan operator Aritmatika</h6></marquee>
</td>
</tr>
</table>
</form>
</body>
</html>

berikut adalah hasil nya…

Kalkulator Online

Iklan

Contoh Penggunaan HTML untuk pembuatan Teks Berjalan(Marquee)





setiadyagung@gmail.com


<html>
<body>
<h3 align=center>
<marquee bgcolor=”green” width=”50%”>A Dramatic Turn Of Events</marquee>
<marquee height=”50px”>Black Clouds & Silver Linings</marquee>
<marquee direction=”left”>Systematic Chaos</marquee>
<marquee direction=”right”>Octavarium</marquee>
<marquee direction=”up”>Train Of Thought</marquee>
<marquee direction=”down”>Six Degrees Of Inner Turbulence</marquee>
<marquee behavior=”scroll”>A Change Of Seasons</marquee>
<marquee behavior=”slide”>Falling Into Infinity</marquee>
<marquee behavior=”alternate”>Awake</marquee>
<marquee>Text atau Gambar Disini</marquee> tanpa scrollamount
<marquee scrollamount=”15″>Images & Words</marquee>
<marquee scrollamount=”50″>When Dream And Day Unite</marquee>
<marquee>Text atau Gambar Disini</marquee> tanpa scrolldelay
<marquee scrolldelay=”300″>Suspended Animation</marquee>
<marquee scrollamount=”600″>JP XI</marquee>
<marquee>Text atau Gambar Disini</marquee> tanpa bgcolor
<marquee bgcolor=”green”>Liquid Tension Experiment</marquee>
</h3>
<marquee loop=”2″>Text atau Gambar Disini</marquee>
<marquee loop=”2″ behavior=”alternate”>Text atau Gambar Disini</marquee>
<marquee loop=”2″ behavior=”slide”>Text atau Gambar Disini</marquee>
Paragraph
<marquee hspace=”10″ bgcolor=”yellow”>Ini contoh hspace</marquee>
Paragraph
Paragraph
<marquee vspace=”30″ bgcolor=”yellow”>ini contoh vspace</marquee>
Paragraph
</body>
</html>

Scipt HTML diatas apabila di jalankan akan memperoleh tampilan di web seperti di bawah ini…


A Dramatic Turn Of Events
Black Clouds & Silver Linings
Systematic Chaos
Octavarium
Train Of Thought
Six Degrees Of Inner Turbulence
A Change Of Seasons
Falling Into Infinity
Awake
Text atau Gambar Disini tanpa scrollamount
Images & Words
When Dream And Day Unite
Text atau Gambar Disini tanpa scrolldelay
Suspended Animation
JP XI
Text atau Gambar Disini tanpa bgcolor
Liquid Tension Experiment

Text atau Gambar Disini
Text atau Gambar Disini
Text atau Gambar Disini
Paragraph
Ini contoh hspace
Paragraph
Paragraph
ini contoh vspace
Paragraph