A little re-cap first, so far we have done HTML and CSS.
You may realize by now, there's not much we can do besides changing content, layout, and styles with them.
That is the limitation of static languages, they are designed for rendering purposes only, not capable of any computation like C++ or Java.
1. Chrome Developer tool (DevTool)
First, we open up the Developer tool
DevTool is a convenient tool for us developer to quickly debug our webpage, change CSS style and modify HTML code.
2. Open the Console tab at DevTool
Now let's start by typing
console.log("Sup?") then press enter.
Now you should see Sup? on the next line.
4. Some real-world use cases (Finished last time)
Now let's write a script to change the background colors of your webpage every 2 seconds.
- Create an array of colors.
- Find the h1 tag DOM element.
- Change it's background color by applying the content of the array at step 1
- delay 2 seconds after each color changes.
4.1 real-world use case II
Display a running digital clock on a page.
5. That's it for today!!