HTML Academy
  • HTML Academy
  • Courses
  • Tutorials
  • Courses
  • Tutorials
  • Sign up
  • Log in
  • Home
  • Interactive courses
  • JavaScript basics
  1. Conditions and creating elements 0/15
  2. Element collections and properties 0/16
  3. Scrolling and operators 0/14
  4. Dynamic element styles 0/16

Chapter 1: Conditions and creating elements

14 tasks, 1 challenge, 1 summary

Let's learn more about what conditions are, how to create and add new elements to a page, and write a like counter and a commenting system.

Start
1. Include the second script Task
2. Creating a like counter Task
3. Changing the counter value Task
4. The classList.contains method, checking for the existence of the class Task
5. The conditional statement if Task
6. The else statement, alternative branches Task
7. Change the value from the markup Task
8. Comments for the news site Task
9. The append method, adding content Task
10. The CreateElement method and creating an element Task
11. Adding an element to the page Task
12. Add a comment when submitting the form Task
13. Changing the properties of the created element Task
14. Finishing the comment section Task
15. Summary of “Conditions and creating elements” Summary
16. Test: Task list Challenge

Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

VISAMastercard

Log in

or

Forgot your password?

Sign up

Sign up

or
Log in

Restore access

Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

Forgot to connect your email to the profile? Email us and we’ll help.

We are using cookies to gather information which will help you use our website most effectively. You can read about this here or disable this feature if you want. By continuing to browse the site, you agree to our use of cookies.