Skip to content

Instantly share code, notes, and snippets.

@adityardiansyah
Created October 23, 2019 14:07
Show Gist options
  • Save adityardiansyah/43017f224337958910997b17ab1b1247 to your computer and use it in GitHub Desktop.
Save adityardiansyah/43017f224337958910997b17ab1b1247 to your computer and use it in GitHub Desktop.
Belajar fungsi Javascript dengan klik tombol
<htmL>
<head>
<title>Belajar JavaScript</title>
<script>
function tambah_semangat(){
var a = document.getElementById("div_semangat");
a.innerHTML += "<p>Sedang Belajar Javascript, Semangat..!!!</p>";
}
</script>
</head>
<body>
<h1>
Belajar Javascript
</h1>
<p>
Saya Sedang belajar Javascript di UMSIDA
</p>
Klik Tombol ini untuk menambahkan kalimat baru :
<button id="tambah" onclick="tambah_semangat()">Semangat ...</button>
<div id="div_semangat"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment