TM 06 - JQuery
Nabila Zakiyah Khansa Machrus
5025201139
5025201139
Penerapan JQuery “Simple Counter”
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous"> | |
<style> | |
.container{ | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
} | |
body{ | |
font-family: 'Times New Roman'; | |
font-size: 18px; | |
} | |
</style> | |
<title>Program Jquery Sederhana</title> | |
</head> | |
<body class="container"> | |
<h2>Program Jquery Sederhana</h2> | |
<br> | |
<br> | |
<br> | |
<center><h1></h1></center> | |
<center><button type="button" class="btn btn-primary">CLICK !!!</button></center> | |
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> | |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script> | |
<script> | |
$(document).ready(function() { | |
var nilai = 0; | |
$(".btn").on("click", function(){ | |
$("h1").html(nilai++); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Komentar
Posting Komentar