diff --git a/README.md b/README.md index 9ff48dd..6590cd0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,13 @@ Edit this document to include your answers after each question. Make sure to lea 5. What is a component? +1. Stands for Document Object Model; represents the HTML elements of a website allowing us to change the structure, content, and styling. It is built as a ‘tree’. +2. Events dictate the interactions with a page. The browser tracks events to determine what to display. +3. There are many events that could occur with a particular element. An event listener can be added to an element so that the element is responsive. +4. Changing the list to an array would allow us to iterate the processes to multiple items instead of the NodeList which requires more specificity and can cause redundancy. +5. A component improves functionality as it combines HTML, CSS, and JavaScript. + + ### Git Set up * [ ] Fork the project into your GitHub user account diff --git a/components/Header/index.js b/components/Header/index.js index c41ba8c..c8a57a5 100644 --- a/components/Header/index.js +++ b/components/Header/index.js @@ -9,4 +9,12 @@ // // And add it to the DOM in the .headerContainer component -function Header() {} +function Header() { + const header = document.createElement('div'); + const date = document.createElement('span'); + const title = document.createElement('h1'); + const temperature = document.createElement('span'); + header.classList.add('header'); + date.classList.add('date'); + temperature.classList.add('temp'); +} diff --git a/components/Tabs/index.js b/components/Tabs/index.js index 5215a3d..57c7f53 100644 --- a/components/Tabs/index.js +++ b/components/Tabs/index.js @@ -7,3 +7,11 @@ // // The tab component should look like this: //
topic here
+ +axios.get('https://lambda-times-backend.herokuapp.com/topics') +.then(response =>{ + console.log(response.data) +}) +.catch( err => { + console.log(err) +}) \ No newline at end of file