The first web-page displaying language I have learned is HTML. Many of people would think HTML is a really easy language to learn and understand, and I also think the same, but HTML is like addition and subtraction we learn in kindergarten. Without knowing how to use the basic operations of math, we would not be able to do any kind of other higher mathematics problems. Just like the basics of mathematics, HTML is the basics of web developing and always needed.
Why is HTML always needed? If I was creating a web-site using JavaScript and a empty HTML page. I would be able to render out the display to the web-page without writing anything to the HTML(except for ,
and ),but even if we are using JavaScript, we would still need to know the HTML syntax to create HTML displays.Example Code:
Example Display:
So on the example code, adding a HTML syntax to a variable and appending it to the div that was created in body is one of the ways to display on web-page using JavaScript. With this JavaScript code, The web page is displayed just like it was created in HTML.
There is one more different example for this written in different way.
Example Code:
Example Display:
The code in JavaScript is written in different way, but the outcome is the same. I do not know all of the differences these codes might consist, but I prefer the second way more. It just looks cleaner and more readable to me.
So the point for showing and explaining these codes were to emphasize that the HTML syntax is the basics of HTML-JavaScript web-development and is the basic essentials that must be mastered.
Top comments (1)