<script type="text/javascript">.[7]<script type="text/javascript"> alert("Halo Dunia!"); </script>
<script type="text/javascript" src="alamat.js"> </script>
<html> <head> <script type="text/javascript"> ... </script> </head> </html>
<body>.[7] Ketika menempatkan skrip pada bagian <body>berarti antara isi dan JavaScript dijadikan satu bagian.[7]<html> <head> </head> <body> <script type="text/javascript"> ... </script> </body> </html>
document.write("pesan ini tampil ketika halaman diload");<html> <head> </head> <body> <script src="xxx.js"> </script> <p>Script di atas berada di berkas "xx.js" (eksternal) </p> </body> </html>
h1 {
color: #0789de;
}
<html>
<head>
<title>Contoh Bentuk Inline </title>
</head>
<body bgcolor="#FFFFFF">
<p id="cth1">
Ini adalah contoh tag P tanpadiformat menggunakan CSS </p>
<p id="cth2" style="font-size:20pt">
Tag P ini diformat dengan besar font 20 point </p>
<p id="cth3" style="font-size:14pt; color:red">
Tag P ini diformat dengan besar font 14 point, dan menggunakan warna merah </p>
</body>
</html>
<html>
<head>
<title>Contoh Bentuk Embedded</title>
</head>
<style>
body {background:#0000FF; color:#FFFF00; margin-left:0.5in}
h1 {font-size:18pt; color:#FF0000}
p {font-size:12pt; font-family:arial; text-indent:0.5in}
</style>
<body>
<h1 id="cth1">Judul ini berukuran 18 dengan warna merah!</h1>
<p id="cth2">Tag p ini di format dengan besar font 12 point dengan tipe font Arial dan mempunyai identasi 0.5 inch </p>
<p id="cth3">Yang perlu diperhatikan juga bahwa body disini telah diformat dengan margin kiri 0.5 inch dan warna background biru</p>
</body>
</html>
<html>
<head>
<style type="text/css">
body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}
</style>
</head>
<body>
<h1>CSS example!</h1>
<p>This is a paragraph.</p>
</body>
</html>