JavaScript Tutorial || Introduction
Introduction to JavaScript
Result
- JavaScript is the programming language of HTML and the Web.
- JavaScript is a lightweight, interpreted programming language
- The programs in this language are called scripts. They can be written right in a web page’s HTML and run automatically as the page loads.
- JavaScript to program the behavior of web pages
- There are many useful Javascript frameworks and libraries available:Angular,React,jQuery,Node.js etc
- It offers full integration with HTML/CSS.
- Simple things are done quickly without any complication or following strict rules.
- Supported by all major browsers and JavaScript is enabled by default.
<!DOCTYPE html> <html><head> <script> function myFunction() { document.getElementById("hello").innerHTML = "welcome js."; }</script> </head> <body><p id="hello">hello javascript</p> <button type="button" onclick="myFunction()">submit</button></body> </html>
Result
" javascript "Paragraph change to "welcome js.
- JavaScript can be implemented using JavaScript statements that are placed within the <script>JavaScript code </script> HTML tags in a web page.
- A function can be called when an event occurs, here when the user clicks a button onclick event in myFunction() function calling
advantages
- Show dynamic content based on the user profile.
- React to user's operations, like mouse clicks events, key presses or pointer movements.
- Support features like auto-validated form entries and interactive drop-down menus.
- Send requests to remote servers, Upload and download files.
- JavaScript code can also create movement and sound
- Ask questions to the users, Get and set cookies, show messages, switch browser tabs.
- Allows the data on to be stored in the local storage.