1611026199
Okay, so I assume you have heard of the almighty DOM — that’s why you are here, right? If you are finding it difficult, I can assure you that after reading this article, you will feel comfortable enough with the whole DOM manipulation thing.
But please before I start, permit me to share with you my little story on how I got to know about the DOM (its a funny story).
A few months into my web development career, I was still learning the good old HTML and CSS. I mistakenly stumbled upon a DOM course on w3schools. The first example they had was one with a light bulb and two buttons.
The onclick of one of the buttons would “switch on” the light bulb and the onclick of the second button would “switch off” the light bulb. I was literally blown away.
How could a button on a website switch on a light bulb? How!?
I even twitted about it. Then I found out that they were just changing the source attribute (src) of the images. I was heart broken, but regardless that little experience made me fall in love with the DOM. It made me want to know more.
And in this article I’m going to walk you through it. I promise that if you stick with me until the end and practice all that I write about, the whole DOM thing won’t be an issue for you ever again. So are you ready? Ok Allons-y (let’s go!).
To make this easier to understand, I have grouped everything into the following sections below.
So grab a coffee or anything you like and relax as I walk you through each section.
The DOM stands for Document Object Model. It can simply be understood as a tree of nodes created by the browser. Each of these nodes has its own properties and methods which can be manipulated using JavaScript.
The ability to manipulate the DOM is one of the most unique and useful abilities of JavaScript.
The image below gives a visual representation of what the DOM tree looks like.
Here we have the document object. This is the core/foundation of the DOM. To perform any form of DOM manipulation, you have to access the document object first.
Next we have the html
root element which is a child of the document object.
Next on the line are the body
and head
elements which are siblings to each other and children of the html
element.
Under the head element we have the title element which you can agree is the child of the head element and parent to the text node - “my text”.
Directly under the body element we have two elements (a
tag and h1
tag) which are siblings to each other and children of the body element.
Finally the href
attribute and the text node - “my link” - are children of the a
tag. Exactly the same way the text node, “My header”, is a child of the h1
element.
This might seem a little confusing if you are an absolute beginner, but trust me - it always gets better (with practice of course).
#javascript #react #web-development #developer #programming
1598446500
SQL is a standard language for storing, manipulating, and retrieving data in databases. In this article, I’ll teach you the very basic fundamentals of the SQL language and hope you will be able to write your own database queries at the end.
SQL stands for Structured Query Language and lets you access and manipulate databases.
Most of the actions you need to perform on a database are done with SQL statements. The following SQL statement selects all the records in the “Users” table:
SELECT * FROM Users;
The select statement is used to retrieve data from a database. The requested data is returned in a results table.
SELECT column1 FROM table_name;
The Select Distinct statement is used to return only distinct (different) values.
SELECT DISTINCT * FROM table_name;
Count
The following SQL statement lists the number of different customer countries:
SELECT COUNT(DISTINCT Country) FROM Customers;
The Where clause is used to filter records.
SELECT column1
FROM table_name
WHERE condition;
For example:
SELECT * FROM Users
WHERE Country='Netherlands';
The Where clause can be combined with AND, OR, and NOT operators. The AND and OR operators are used to filter records based on more than one condition:
The NOT operator displays a record if the condition(s) is NOT TRUE.
AND
SELECT column1, column2, ...
FROM table_name
WHERE condition1 AND condition2 AND condition3 ...;
OR
SELECT column1, column2, ...
FROM table_name
WHERE condition1 OR condition2 OR condition3 ...;
NOT
SELECT column1, column2, ...
FROM table_name
WHERE NOT condition;
#tech #guides-and-tutorials #sql #beginners-guide #programming
1598286933
The Ultimate React Guide For Beginners In 2020. By Caspar Camille Rubin on Unsplash. React is a JavaScript library created by Facebook and is a great tool for building UI components.
#programming #javascript #guides-and-tutorials #tech #beginners-guide
1592612040
This video on Querying DOM in jQuery will help you understand the DOM manipulation methods with hands-on.
#dom manipulation tutorial #jquery dom
1626443100
In this lesson, we learn about the Document Object Model. We learn what the DOM, Shadow DOM, and Virtual DOM are and how they work. We also look at some of the practical examples to understand them better.
#dom #shadow dom #virtual dom
1598437620
Java is a high-level programming language. It was initially designed for developing programs for set-top boxes and handheld devices, but later became a popular choice for creating web applications. The Java syntax is similar to C++ but is strictly an object-oriented programming language.
I hope with this article that you’ll learn and understand the fundamentals of Java.
The first thing you need to do is install Java, and you can install an IDE such as Eclipse or IntelliJ.
#guid #java #programming #beginner #tech