Untitled
unknown
plain_text
10 months ago
1.8 kB
3
Indexable
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="main.js" defer></script>
<title>Document</title>
</head>
<body>
<div class="head">
<h1>KURSY</h1>
</div>
<div class="box">
<div class=left>
<h2>Lista</h2>
<ul>
</ul>
</div>
<div class="right">
<h2>Zapisz się:</h2>
<form method="post">
<input type="text" id="name" name="name" placeholder="Podaj Imie i Naziwsko:" required>
<br>
<input type="number" id="kurs" name="kurs" placeholder=" Podaj numer kursu: " required>
<br>
<button type="submit" name="zapisz" id="zapisz">Zapisz</button>
</form>
</div>
</div>
<div class="foot">
<p>PESEL</p>
</div>
</body>
</html>
const ul = document.querySelector("ul")
const form = document.querySelector("form")
form.addEventListener("submit", e => {
const name = e.target[".name"].values
const kurs = e.target[".kurs"].values
alert(`${name} Zapisał się na ${kurs}.`)
})
* {
box-sizing: border-box;
margin: 0;
}
.box{
display: flex;
}
.left{
height: 450px;
background-color: lightgreen;
padding: 20px;
width: 40%;
}
.right{
height: 450px;
background-color: yellow;
padding: 20px;
width: 60%;
}
.head{
height: 100px;
background: red;
text-align: center;
}
.foot{
background-color: black;
height: 60px;
text-align: center;
color: white;
}
Editor is loading...
Leave a Comment