Мой вопрос, когда мы выбираем элементы уровня HTML или элемент контейнера, используя QuerySelector, GetElementById и т. Д., Как он содержит все элементы детей? class = "Snippet">
Код: Выделить всё
let add_btn = document.querySelector('.add');
let container = document.querySelector('.container');
let createNote = document.querySelector('.create-note');
let close = document.querySelector('.close-btn');
add_btn.addEventListener('click', () => {
createNote.style.display = 'block';
})< /code>
.create-note {
width: 441px;
height: 316px;
border: 1px solid #ccc;
background-color: white;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
border-radius: 10px;
position: absolute;
top: 22%;
left: 34%;
display: none;
}< /code>
New Note
Create Note
Close
Подробнее здесь: https://stackoverflow.com/questions/794 ... ents-in-it