Skip to content

Instantly share code, notes, and snippets.

@fabrinal
Created October 22, 2016 07:42
Show Gist options
  • Save fabrinal/5766fb66e214d97b7b4a9bf8502b70e5 to your computer and use it in GitHub Desktop.
Save fabrinal/5766fb66e214d97b7b4a9bf8502b70e5 to your computer and use it in GitHub Desktop.
Contoh kode untuk ngoding offline

Petunjuk untuk cara mudah ngoding offline

  1. Copy paste kode di bawah
  2. Save menggunakan text editor (notepad,notepad++,sublime dll) dengan "namanya_terserah.html"
  3. Buka file namanya_terserah.html menggunakan browser.
  4. Lalu klik kanan di browser -> pilih inspect/Inspect Element -> pilih Console.
  5. Perhatikan hasil outputnya.
<html>
    <head>
        <title>Offline Site</title>
    </head>
    <body>
        <h1>Offline Coding</h1>
        <h2><span style="color: red;">Yeyeye</span> <span style="color: yellow;">Lalala</span></h2>
        <script>
            var a = 10;
            var b = 20;
            var c = "DILO";
            for (var i = 0; i < 10;i++){ console.log(i); }
            var result = a + b;
            console.log("hasil a + b adalah " + result + " " + c);
        </script>
    </body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment