Lekcja 7
This commit is contained in:
@@ -2,6 +2,7 @@ const nawigacjaLinki = [
|
|||||||
{ nazwa: "Tabele", link: "/tabele.html" },
|
{ nazwa: "Tabele", link: "/tabele.html" },
|
||||||
{ nazwa: "Grafika", link: "/grafika.html" },
|
{ nazwa: "Grafika", link: "/grafika.html" },
|
||||||
{ nazwa: "JS. Funkcje", link: "/js-funkcje.html" },
|
{ nazwa: "JS. Funkcje", link: "/js-funkcje.html" },
|
||||||
|
{ nazwa: "JS. Zdarzenia", link: "/js-zdarzenia.html" },
|
||||||
];
|
];
|
||||||
const stopkaLinki = [
|
const stopkaLinki = [
|
||||||
[
|
[
|
||||||
@@ -16,6 +17,7 @@ const stopkaLinki = [
|
|||||||
{ nazwa: "JS. Podstawowe Zad.", link: "/js-podstawy.html" },
|
{ nazwa: "JS. Podstawowe Zad.", link: "/js-podstawy.html" },
|
||||||
{ nazwa: "JS. Zad. Warunkowe", link: "/js-warunkowe.html" },
|
{ nazwa: "JS. Zad. Warunkowe", link: "/js-warunkowe.html" },
|
||||||
{ nazwa: "JS. Funkcje", link: "/js-funkcje.html" },
|
{ nazwa: "JS. Funkcje", link: "/js-funkcje.html" },
|
||||||
|
{ nazwa: "JS. Zdarzenia", link: "/js-zdarzenia.html" },
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"HTML",
|
"HTML",
|
||||||
|
|||||||
74
js-zdarzenia.html
Normal file
74
js-zdarzenia.html
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="pl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>JS Zad. Zdarzenia - MaszToZadanieDomowe.com</title>
|
||||||
|
<link href="/favicon.ico" rel="favicon">
|
||||||
|
<link href="/assets/css/main.css" rel="stylesheet">
|
||||||
|
<script data-goatcounter="https://zeszyt.nonamesoft.xyz/count" async src="/assets/js/count.js"></script>
|
||||||
|
<script type="module" src="/assets/js/index.js"></script>
|
||||||
|
<script src="/assets/js/js-wspolne.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#kontener {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
border: 3px solid beige;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
|
document.querySelector("#kontener").addEventListener("click", (ev) => {
|
||||||
|
ev.target.style.backgroundColor = `rgb(${Math.floor(Math.random() * 255)}, ${Math.floor(Math.random() * 255)}, ${Math.floor(Math.random() * 255)})`;
|
||||||
|
})
|
||||||
|
|
||||||
|
document.querySelector(".wyroznione").addEventListener("dblclick", (ev) => {
|
||||||
|
ev.target.innerText = ev.target.innerText == "Zadupie dolne" ? "Wielkośląskie" : "Zadupie dolne"
|
||||||
|
})
|
||||||
|
document.querySelector(".wyroznione").addEventListener("mouseover", (ev) => {
|
||||||
|
console.log(ev.target.innerText)
|
||||||
|
})
|
||||||
|
|
||||||
|
document.querySelector("#artykul").addEventListener("keydown", (ev) => {
|
||||||
|
ev.preventDefault()
|
||||||
|
if (new Number(ev.key).toString() != "NaN") {
|
||||||
|
document.querySelector("#aaa").innerText += ev.key
|
||||||
|
}
|
||||||
|
ev.target.value += " ";
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header-comp></header-comp>
|
||||||
|
<main>
|
||||||
|
<h2>JavaScript Zdarzenia</h2>
|
||||||
|
<hr>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
<h4>Łapcie :3</h4>
|
||||||
|
<hr>
|
||||||
|
<div id="kontener">
|
||||||
|
🐾
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<h4>Wyróżnienie</h4>
|
||||||
|
<hr>
|
||||||
|
<p class="wyroznione">Zadupie dolne</p>
|
||||||
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<h4>Artykuł</h4>
|
||||||
|
<hr>
|
||||||
|
<textarea id="artykul">"Gdzie my zmierzamy jako społeczeństwo?" - Cyborg 2025</textarea>
|
||||||
|
<div id="aaa"></div>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</main>
|
||||||
|
<footer-comp></footer-comp>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user