Lekcja 1 - ćwiczenia i zadanie

This commit is contained in:
floriano committed 2026-09-13 18:22:03 +02:00
1 parent 1c1d616161
commit 28836af2ee
9 files changed
+9946

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery Lekcja 1</title>
<script src="lib/jquery.js"></script>
<script>
$(document).ready(function () {
let counter = 0
$("#d1").on("click", function () {
++counter % 2 == 0 ? $("#d1").css("background-color", "green") : $("#d1").css("background-color", "red")
$("#d1").text(counter)
})
})
</script>
<style>
#d1 {
width: 100px;
height: 100px;
background-color: green;
color: azure;
font-size: 2em;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div id="d1">0</div>
</body>
</html>