Contoh Kode JavaScript Sederhana

<script type="text/javascript">
var nama = 'anto';
for(i = 0; i < 5; i++){
     alert(i);
}
function hay(){
   alert('hay');
}
hay();
</script>

Sumber : http://www.developer-id.com/