Use 'clone or download' button to download this repo as zip.
- Edit the CSS by following techer's instructions.
Task B, JavaScript HTML DOM
- Create new file task-b.html
- Copy the content of index.html and paste it to task-b.html
- Change the src of
<script>
element to main-b.js - Add another
<article>
element to<main>
by modifying js/main-b.js:- The new
<article>
element should containt the same elements as the existing<article>
element - Select
<main>
element with DOM-methods - Use innerHTML property to add the new
<article>
element to<main>
element. - Note that you need to use
+=
operator to add. - If you want to make a multiline string for the HTML, you need to use + operator or create a template string
- The new
Task C, JavaScript HTML DOM Elements
- Create new file task-c.html
- Copy the content of index.html and paste it to task-c.html
- Change the src of
<script>
element to main-c.js - Add another
<article>
element to<main>
:- The new
<article>
element should containt the same elements as the existing<article>
element - Select
<main>
element with DOM-methods - Use DOM methods (createElement, appendChild) to add the new
<article>
element to<main>
element.
- The new
Task D, content from array by iterating
- Create new file task-d.html
- Copy the content of index.html and paste it to task-d.html
- Change the src of
<script>
element to main-d.js - Delete the
<article>
element from<main>
in your editor. - Add
<article>
elements to<main>
by iterating picArray with for loop (main-d.js).- The new
<article>
elements should containt the same elements as the existing<article>
element - Select
<main>
element with DOM-methods - Use DOM methods (createElement, appendChild) or innerHTML property to add the new
<article>
elements to<main>
element.- put title to
<h2>
and<img>
element's alt attribute - put caption to
<caption>
element - put filename to
<img>
element's src attribute - put description to
<p>
element
- put title to
- The new