A Brief History
- Change the content of an HTML element
- Show or hide elements based on user input
- Validate form data before submission
- Create and manipulate arrays and objects
- Animate elements, like fading in or sliding out
- Fetch data from a server and display it on your site
<script> tag or placed in separate
.js files, which can be linked to the HTML document.
When you click the button, the
showAlert function is called and a popup saying "Hello, World!" appears.
Variables and Data Types
.js extension and link to it in your HTML file using the
- Variables: Used to store data, like numbers, strings, and objects.
- Data types: Including strings, numbers, booleans, objects, and more.
- Functions: Reusable pieces of code that perform specific tasks.
- Conditional statements: Allow your code to make decisions based on conditions.
- Loops: Enable you to repeatedly execute code blocks.
- Events: Actions or occurrences, like a user clicking a button, that your code can respond to.
Ctrl + Shift + J (Windows/Linux) or