Tugas 5 - JQuery Sederhana
Nama : Agnesfia Anggraeni
NRP : 5025201059
Tahun : 2022/2023
Kelas : Pemrograman Web C
Membuat Program JQuery Sederhana
Hasil
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"/> | |
<title>Counter Click!</title> | |
</head> | |
<body class="text-light" style="margin: 100px; padding: 50px; box-sizing: border-box; font-family: 'Verdana'; | |
background-image: linear-gradient(rgba(9, 159, 246, 0.8), rgba(104, 186, 216, 0.8)), url(/images/ya.jpg); | |
height: 100vh; background-position: center; background-repeat: no-repeat; background-size: cover; background-attachment: fixed;"> | |
<h2 class="text-center font-weight py-4" style="color: black;">Click the button to start counting!</h2> | |
<center> | |
<button type="button" class="btn btn-primary btn-lg text-center font-weight py-2" style="background-color:rgba(12, 117, 178, 0.685); background-size: 100px;"> Tap here </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 value = 1; | |
$(".btn").on("click", function() { | |
$("h2").html(value++); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Komentar
Posting Komentar