Pemrograman Web B Latihan Pertemuan 6 : Membuat Contoh Website dengan JQuery
Membuat Website dengan JQuery
Andhika Ditya Bagaskara D.
5025201096
Pada pertemuan ke-6 ini, kami diberikan latihan untuk membuat tampilan web menggunakan JQuery.
Tampilan:
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"/> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto"/> | |
<title>CounterButton</title> | |
</head> | |
<body class="text-light" style=" margin: 100px; padding: 0px; box-sizing: border-box; font-family: 'Roboto'; | |
background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url(images/dgp.jpg); | |
height: 100vh; background-position: center; background-repeat: no-repeat; background-size: cover; background-attachment: fixed;"> | |
<h1 class="text-center font-weight-bold py-4">Press the Button to Start the Count!</h1> | |
<h2 class="text-center font-weight-bold py-2"></h2> | |
<center> | |
<button type="button" class="btn btn-danger text-center font-weight-bold py-2"> Press Me! </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