
Introduction to JavaScript

Photo by Pankaj Patel on Unsplash
JavaScript is one of the programming languages that must be mastered in web development. In this article, we will learn about JavaScript, or an Introduction to Javascript. At least there are three languages that a web developer must master:
- HTML to create the layout of a web page
- CSS to control the appearance, layout, background, and color of a web element
- JavaScript to control the behavior of an element interactively
In its development, JavaScript is no longer limited to just supporting web programming; it can now handle backend systems, mobile, server, desktop programming, and much more. You can find several articles on this topic, including this one:
http://www.creativebloq.com/web-design/things-you-didnt-know-javascript-could-do-6122835
Through this blog, I will try to share my learning experience of becoming a web developer. Regardless of who the readers are, all of the above technologies can be mastered if we are determined. There is a saying, “practice makes perfect,” so to become an expert in any field, what is needed is to consistently repeat something over and over.
I have several references for learning JavaScript, two of which are below, which I used as a guide to write this blog:
- https://www.w3schools.com/js/default.asp
- https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript
1. JavaScript can change HTML content
We can modify HTML elements based on their element name, id, class, and other selectors. Below, I will demonstrate how to change an HTML element using its id (document.getElementById).
2. JavaScript can change HTML element attributes
We can change the value of an element’s attribute by using a selector and writing the attribute name. Below, I will show how to change the `src` attribute of an image using the getElementById selector.
3. JavaScript can change CSS styles
We can change the style of an element’s attribute using a selector, then adding the style and its value. Below, I will demonstrate how to change the background using the getElementById selector.
That’s a brief explanation of JavaScript introduction that Mangcoding wanted to share. Interested in learning more? We can take it slow, starting from the very basics. So, don’t worry! If you have any questions about the material, feel free to ask in the comments section.