Today’s Goals:
- Continuing learning basic JavaScript
- getElementById() method
- The canvas tag (dynamic HTML & JS combined)
Today’s featured website:
- https://factcheckingday.com/– What follows April Fools’ Day? International Fact-checking Day.
April Desktop Wallpaper!
JavaScript Methods
- From W3Schools: JavaScript methods are the actions that can be performed on objects. Almost everything is an object (one example we’ve used so far- functions). Objects are collections of properties with values. JavaScript is an object-oriented programming (OOP) language.
- You are going to practice JavaScript’s getElementById() method, which can dynamically change HTML and CSS by finding id’s on the webpage. You will use examples from this tutorial. What is an id again? We learned about them when we began CSS.
- First, download this code. Then, copy and paste the code into a new Notepad++ page (save it as js_methods.html).
- You’re going to change the code by following the instructions! Make sure to read the comments inside the code to figure out what to do.
- When you’re done: Check out the canvas tag, which makes use of JavaScript’s getElementById() method and is used to create graphics, images, and animations. Follow this tutorial at your own pace by reading the explanations, clicking “try it yourself”, changing the code, and clicking “next” when done.