Introduction to JavaScript
Goal
- âš¡ Understand what is javascript
What is JavaScript ?
From wikipedia...
Alongside HTML and CSS, JavaScript is one of the core technologies of the World Wide Web. JavaScript enables interactive web pages and is an essential part of web applications. The vast majority of websites use it, and major web browsers have a dedicated JavaScript engine to execute it.
https://en.wikipedia.org/wiki/JavaScript
Okay, so first let's check the example of interactivity by javascript.
Preparation
Please make javascript-test
folder and create js-test1.html
inside it.
Then, make html boilerplate and add <div id="demo">Click here</div>
.
Check the output
Nothing happened if you clicked.
Try First JavaScript
You don't need to understand the meaning of this code right now!
This is just a example to understand the meaning of interactive.
Please copy and paste the code.
Ref:
- https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onclick
- https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics
Check the output
Do you understand the meaning of "interactive" ?
Interactive means...
- You (user) click
- Then something happens
This is interactive right ?
In the next step, we will learn the meaning of this javascript code.