It’s not compulsory to learn HTML and CSS before learning JavaScript. But it’s necessary so as to understand JavaScript even more.

I’ve seen alot of students who want to pursue a career in web development starting with JavaScript as their first language. This isn’t bad if you’re familiar with other programming languages like python, java or c++ but I’ll advise you to start your journey with HTML and basic CSS due to some specific reasons which I’m going to list out in this article. If your new to web development, then you’re in the right place.

HTML, CSS and JavaScript are the three main languages used for frontend web development in these modern times. HTML, short for HyperText Markup Language, being the backbone of every website found on the web was developed by a Tim berners Lee in 1991. HTML can be used alone in creating a static website and it is the most important language in the creation of any website. See why HTML worth learning for web development.

HTML is usually combined with CSS (cascading style sheet) because websites built with html alone is not visually presentable. The era of the web has evolved and each website should has a standard design which would be appealing to your websites visitors. That’s where CSS comes in.

With CSS, you can style the different parts of the page and make it as beautiful as it can be. Different styles like background colors, images, border styles, filters and animations are available with CSS which makes your website outstand other websites out there.

While learning JavaScript, you’ll first of all learn it as a normal programming language like php, python or even swift but towards the end of a course, that is if you’re learning from a good source like W3schools or Sololearn, you’ll be taught about the document object model (DOM). You’ll also learn how to manipulate certain HTML and CSS features using JavaScript. This is called client side scripting and it is the main reason JavaScript was created for the web. HTML and CSS are also important for the basics of some backend programming like php in order to display the results obtained from the server in your webpage making it dynamic. See more details about learning php for web development.

This DOM is a representation of a webpage in a tree like structure which is more like a family tree where html tags are represented as parent and child tags. Read more about the DOM in w3schools DOM tutorial.

Let’s say we have this HTML code on our web page.

<div>
<p>
This is a HTML paragraph
</p>
</div>

With the DOM, JavaScript reads the above code as child and parents elements where the div tag acts as a parent while the p tags acts as the child. Using this hierarchy, JavaScript can easily manipulate the contents of either the div or the paragraph tags using some basic functions.

To understand the DOM, you need a basic knowledge of HTML and CSS and become familiar with it’s most basic syntaxes because this DOM is all about changing the contents of the webpage or manipulating the HTML using JavaScript events. With the DOM, JavaScript can

  • Change the HTML elements in a page.
  • Change the HTML attributes of a page and it’s properties.
  • Change the CSS styles of a page.

Understanding how to manipulate the DOM makes you better in your JavaScript programming and it’s also a step in understanding most JavaScript frameworks like react.js, angular.js even jQuery.

This DOM is the main reason why HTML and CSS are necessary before diving into learning JavaScript. Hope this article answered your question, if it didn’t, feel free to tell us in the comments section, we’re always open to new comments. Incase you still find it difficult to pick your programming language, check out our Guide to choosing a programming language for your career.

Also don’t forget to follow us on our social media platforms using the links below

Kudos on your web development journey!


vic okeke

I'm just a web developer hoping to help out junior developers in algorithms for their projects.

6 Comments

Blaize Channel · July 19, 2021 at 9:29 pm

The article I’ve been looking for, since 2019

Tony Divine · July 19, 2021 at 2:18 pm

Best content ever with perfect information

    kid charming · July 19, 2021 at 9:03 pm

    You’re welcome 😎. Thanks for the feedback

Eben · July 9, 2021 at 1:59 pm

This content is unique
Thanks alot for providing this

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: