Pemrograman Web C - Latihan JQuery
Ahmad Ibnu Malik Rahman
5025201232
Source Code:
This file contains hidden or 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; | |
} | |
</style> | |
<title>Latihan Program Jquery</title> | |
</head> | |
<body class="container"> | |
<h2>Program Jquery</h2> | |
<br> | |
<br> | |
<br> | |
<center><h1></h1></center> | |
<center><button type="button" class="btn btn-primary">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 nilai = 1; | |
$(".btn").on("click", function(){ | |
$("h1").html(nilai++); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Dokumentasi:
Repository: Repository
Komentar
Posting Komentar