<html lang="ru">
<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">
<title>To do list</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
<h1>What are your plans for today?</h1>
</div>
<div class="container">
<input class="inputField" type="text">
<button type="submit" class="btn">+</button>
</div>
</body>
<script src="app.js"></script>
</html>
.header, .container {
display: flex;
justify-content: center;
}
h1 {
font-size: 60px;
background: linear-gradient(to left, #aa4b6b, #3b8d99);
text-fill-color: transparent;
background-clip: text;
}
.inputField {
padding: 10px;
width: 40%;
border: none;
}
.btn {
padding: 20px;
background: #3b8d99;
border: none;
}
body {
background-image: url(photo-1506619216599-9d16d0903dfd.avif);
background-repeat: no-repeat;
background-size: cover;
min-height: 100vh;
background-position: center;
background-color: rgb(251, 215, 161);
}
const input = document.querySelector('.inputField');
const btn = document.querySelector('.btn');
const toDoContainer = document.querySelector('container');
btn.addEventListener('click', function() {
const toDoItem = document.createElement('li');
toDoItem.innerText = input.value;
toDoContainer.appendChild(toDoItem);
console.log(toDoItem);
});
console.log(input);
console.log(btn);
console.log(toDoContainer);
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.