Building Your Learning Module...
Getting things ready for you!
Find videos you like?
Save to resource drawer for future reference!
Built-in properties of HTML elements
element.setAttribute('href', 'url')CSS styling groups you can toggle
element.classList.add('active')Click each card to see practical examples
Use when: Changing where links go or how they open
link.href = 'https://example.com';link.target = '_blank';Use when: Changing images or alt text
img.src = 'photo.jpg';img.alt = 'Beautiful sunset';Use when: Enabling/disabling inputs, getting values
btn.disabled = true;const text = input.value;Add a class to element
element.classList.add('active')Remove a class from element
element.classList.remove('active')Switch class on/off
element.classList.toggle('hidden')Check if has class
element.classList.contains('active')element.className = 'new-class'; // Removes ALL existing classes!
element.classList.add('new-class');
// Keeps existing classeselement.setAttribute(href, 'url'); // Error: href is not defined
element.setAttribute('href', 'url');
// ✅ Attribute name in quotes