JS6 ClassNotes
JS6 ClassNotes
HTML CSS JS
(structure) (style) (logic)
Starter Code
<style> tag connects HTML with CSS
document.getElementsByClassName(“myClass”)
document.getElementsByTagName(“p”)
DOM Manipulation
Query Selector
innerText : returns the text content of the element and all its children
Qs. Create 3 divs with common class name - “box”. Access them & add some unique text to each
of them.
DOM Manipulation
Attributes
Style
node.style
DOM Manipulation
Insert Elements let el = document.createElement(“div“)
Delete Element
Insert the button as the first element inside the body tag.
Qs. Create a <p> tag in html, give it a class & some styling.
Now create a new class in CSS and try to append this class to the <p> element.
Did you notice, how you overwrite the class name when you add a new one?
Solve this problem using classList.