document.querySelector('.class'); document.querySelectorAll('.class');
const element = document.getElementById('example'); element.innerHTML = '<b>Updated Content</b>'; element.style.color = 'red';
const button = document.querySelector('button'); button.addEventListener('click', () => console.log('Clicked!')); button.addEventListener('mouseover', () => console.log('Hovered!'));
const parent = document.querySelector('.parent'); const children = parent.children; console.log(children);
const newDiv = document.createElement('div'); newDiv.textContent = 'Hello, World!'; document.body.appendChild(newDiv);
document.querySelector('#list').addEventListener('click', event => { if (event.target.tagName === 'LI') { console.log(`Item ${event.target.textContent} clicked.`); } });