EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • Featured Skills
    • New & Trending
    • Fresh Entries
    • Finance
    • Data Science
    • Programming and Dev
    • Excel
    • Marketing
    • HR
    • PDP
    • VFX and Design
    • Project Management
    • Exam Prep
    • All Courses
  • Blog
  • Enterprise
  • Free Courses
  • Log in
  • Sign Up

JavaScript Tutorial

Home Software Development Software Development Tutorials JavaScript Tutorial

Basic

What is JavaScript

What JavaScript Can Do?

Uses of JavaScript

How JavaScript Works?

Is Javascript Case Sensitive?

Is Javascript Object Oriented

Features of JavaScript

Cloudflare JavaScript

Scraper JavaScript

Careers in JavaScript

How to Install JavaScript

JavaScript Request

Best Javascript Frameworks

JavaScript MVC Frameworks

JavaScript Tools

Convert String to JSON

Convert Text to JSON

Decision tree javascript

JavaScript Stream

Dataset JavaScript

Observable JavaScript

appendChild JavaScript

Slideshow in JavaScript 

JavaScript formatter

Javascript Canvas

JavaScript Dictionary

JavaScript max

JavaScript return

JavaScript String to Date

JavaScript Iterator

popup menu JavaScript

XML Parsing in JavaScript

Authentication JavaScript

JavaScript flatmap

Local Variable in JavaScript

Timestamp to Date in JavaScript

textContent in JavaScript

What is JSON?

What is Redux?

Uses of React JS

How Analytics.JS Works?

JavaScript Compilers

JavaScript Literals

Javascript Constants

JavaScript Filter List

JavaScript onunload

JavaScript openWindow

JavaScript Thread

JavaScript Disable Button

JavaScript Button

JavaScript RegEx Test

Variables in JavaScript

JavaScript Global Variable

JavaScript Keywords

String in JavaScript

JavaScript String to Boolean

Javascript String to Lowercase

Pointers in JavaScript

Primitive Data Types in JavaScript

JavaScript Data Types

JavaScript console log

JavaScript console log

Arithmetic in JavaScript

Assignment Operator in JavaScript

JavaScript Modules

Cheat Sheet JavaScript

Sprintf JavaScript

NPM Alternatives

Objects

JavaScript History Object

Javascript Object Key

Convert Object to Array Javascript

JavaScript Object Notation (JSON)

JavaScript forEach Array

JavaScript Object Methods

JavaScript Map Object

JavaScript Date Object

JavaScript Window Object

JavaScript Object Constructors

JavaScript Clone Object

JavaScript Object.assign()

JavaScript object.is()

JavaScript Object to JSON

Operators

Arithmetic Operators in JavaScript

JavaScript Assignment Operators

Logical Operators in JavaScript

Comparison Operators in JavaScript

Bitwise Operators in JavaScript

Ternary Operator JavaScript

Boolean Operators in JavaScript

JavaScript Modulo

JavaScript Boolean()

Unary Operators in JavaScript

JavaScript Number

JavaScript Floating

JS Operator Precedence

Control statements

Control Statement in JavaScript

Conditional Statements in JavaScript

Break Statement in JavaScript

Continue in JavaScript

Switch Statement in JavaScript

Case Statement in JavaScript

JavaScript if Statement

Nested if in JavaScript

JavaScript if else

Loops

For Loop in JavaScript

While Loop in JavaScript

Do While Loop in JavaScript

Nested Loop in JavaScript

Array

Arrays in JavaScript

2D Arrays in JavaScript

JavaScript Append to Array

Multi-Dimensional Array in JavaScript

Associative Array in JavaScript

JavaScript Declare Array

Arrays Methods in JavaScript

JavaScript Loop Array

String Array in JavaScript

JavaScript Get Array Length

JavaScript Merge Arrays

JavaScript Array Sort

JavaScript Array Push

JavaScript Iterate Array

JavaScript Empty Array

JavaScript Array Concat

Dynamic Array in JavaScript

JavaScript subarray()

JavaScript Array Filter

JavaScript Nested Array

JavaScript Flatten Array

JavaScript Array map()

JavaScript Array from()

JavaScript Array includes()

JavaScript Array Contain

JavaScript Array Slice

JavaScript Copy Array

Javascript Sum Array

Javascript Array to JSON

JavaScript reverse Array

JSON Parse Array

Sorting

Sorting in JavaScript

Sorting Algorithms in JavaScript

Insertion Sort in JavaScript

Merge Sort in JavaScript

Quick Sort in JavaScript

Bubble Sort in JavaScript

pop() in JavaScript

push() in JavaScript

Sort string in JavaScript

Selection Sort in JavaScript

Functions

JavaScript String Functions

JavaScript String Length

JavaScript split String

JavaScript Math Functions

Recursive Function in JavaScript

Regular Expressions (RegExp) in JavaScript

JavaScript Arrow Function

JavaScript Date Function

Match Function in Javascript

Replace Function in JavaScript

JavaScript Call Function

JavaScript Pass By Value

split() Function in JavaScript

Array reduce() Function JavaScript

reCAPTCHA Javascript

JavaScript String replace

JavaScript Compare Strings

JavaScript Concatenate Strings

JavaScript toString

JavaScript Sleep

JavaScript toLowercase()

JavaScript String to Float

JavaScript String to Number

JavaScript String to int

JavaScript Object to String

JavaScript Convert to JSON

JavaScript Append

Javascript Array to String

Javascript Nested Functions

Set in JavaScript

Vectors in JavaScript

Javascript Anonymous Function

sign() in JavaScript

isNaN() JavaScript

Slice() Method in JavaScript

Javascript void(0)

endsWith() in JavaScript

trim() Function in JavaScript

JavaScript has()

JavaScript Fill()

JavaScript typeof

JavaScript indexOf()

JavaScript encodeURI()

JavaScript Random

Ceil() in JavaScript

JavaScript tofixed

JavaScript hash()

Hash Table JavaScript

JavaScript MD5

JavaScript search

JavaScript z-index

JavaScript Absolute Value

JavaScript Closure

Javascript Prototype

JavaScript Debugging

JavaScript Yield

JavaScript Date parse

JavaScript DatePicker

JavaScript Parse String

JavaScript undefined

JavaScript FileReader

JavaScript Style visibility

JavaScript sleep Function

JavaScript forEach()

JavaScript keys()

JavaScript keycodes

JavaScript find()

JavaScript values()

JavaScript Counter

JavaScript Countdown

JavaScript instanceof

JavaScript Delay

JavaScript Default Value

JavaScript concat String

JavaScript Document Object Model

Unshift JavaScript

JavaScript Callback Function

JavaScript hasOwnProperty()

JavaScript UUID

JSON Parser

JSON Array of Strings

JSON Object to String

Convert JSON to CSV in Python

Sublime Pretty JSON

JavaScript JSON to string

JavaScript Uppercase

JavaScript Namespace

JavaScript Range

JavaScript JSON

JavaScript exec()

JavaScript test()

round() in JavaScript

JavaScript Self Invoking Functions

JSON Stringify Pretty

JavaScript findIndex()

JavaScript entries()

JavaScript join()

JavaScript String lastIndexOf()

JavaScript every()

JavaScript getElementById()

JavaScript getElementsByName()

JavaScript getElementsByTagName()

JavaScript getElementsByClassName()

JavaScript Animation

JavaScript Minify

Events

JavaScript Events

JavaScript Event Handler

JavaScript Timing Events

JavaScript Keyboard Events

JavaScript Event Listener

JavaScript Mouse Events

JavaScript mouseover

JavaScript mousemove

JavaScript mousedown

JavaScript onchange

JavaScript onmouseout

JavaScript Onkeydown

JavaScript onsubmit

JavaScript Form Events

JavaScript Window Events

JavaScript Custom Events

JavaScript Alert

JavaScript Confirm

JavaScript onclick Alert

JavaScript Apply

JavaScript onblur

JavaScript onkeyup

JavaScript onfocus

Advanced

Constructor in JavaScript

Clear Cache JavaScript

JavaScript Test Undefined

Inheritance in JavaScript

JavaScript Projects Examples

WebGL JavaScript

Map in JavaScript

Compiled JavaScript

Polymorphism in JavaScript

JavaScript Color Picker

JavaScript Static Method

Navigator in JavaScript

JavaScript onload

JavaScript onresize

JavaScript isnull

Abstract Classes in JavaScript

"this" keyword in JavaScript

Overriding in JavaScript

JavaScript Clear Console

JavaScript References

JavaScript list

JavaScript Grid

JavaScript innerText

Cookies in JavaScript

Delete Cookie in JS

Encapsulation in JavaScript

JavaScript Parent Node

JavaScript Parent

Javascript Remove Element

Errors in JavaScript

Forms in JavaScript

JavaScript Validator

JavaScript Form Validation

Email Validation in JavaScript

Hamburger Menu JavaScript

JavaScript Date Formats

JavaScript Number Format

JavaScript Debugger

JavaScript Stack

Queue in JavaScript

parseFloat in JavaScript

Javascript innerHTML

JavaScript setInterval

JavaScript Popup Box

JavaScript Message Box

Lightbox in JavaScript

Javascript Design Patterns

addEventListener JavaScript

Timer in JavaScript

JavaScript setTimeout

JavaScript clearTimeout()

JavaScript String Format

JavaScript Scroll to Top

Functions in JavaScript

JavaScript Function Declaration

JavaScript Function Arguments

Javascript Strict Mode

File Handling in JavaScript

JavaScript parseInt

JavaScript prompt

JavaScript Set Class

JavaScript Try Catch

Javascript Throw Exception

Finally in JavaScript

JavaScript Get Element by Class

JavaScript Obfuscator

Disable JavaScript

SetAttribute JavaScript

Javascript Map Function

JavaScript Tooltip

NativeScript Plugin

JavaScript some

JavaScript Redirect

JavaScript bind

JavaScript proxy()

JavaScript Reflect

JavaScript Toggle

JavaScript Cursor

LinkedList in JavaScript

JavaScript WeakMap

JavaScript DOM

JavaScript defer

JavaScript Promise

Pagination in JavaScript

JavaScript Refresh Page

JSON.stringify JavaScript

Avro to JSON

JavaScript IIFE

JavaScript Fetch API

Binary Tree JavaScript

JavaScript Underscore

JavaScript Calculator

JavaScript Image Slider

JavaScript Auto Complete

JavaScript Test Automation

JavaScript Copy to Clipboard

JavaScript querySelector

JavaScript Graph

JavaScript Testing Frameworks

Gulp js

Gulp.js

Gulp Browser-sync

Gulp CLI

Gulp Build

Gulp rename

Gulp serve

Gulp clean

Gulp replace

Gulp less

Gulp ESLint

Gulp rev

Gulp npm

Gulp Task

Gulp imagemin

Gulp Concat

Programs

Patterns in JavaScript

Reverse in JavaScript

Palindrome in JavaScript

Factorial Program in JavaScript

Fibonacci Series In JavaScript

Square Root in JavaScript

Prime Number in JavaScript

Armstrong Number in JavaScript

Random Number Generator in JavaScript

Reverse String in JavaScript

JavaScript Random String

Object Oriented Programming in JavaScript

Functional Programming in JavaScript

Interview Questions

Javascript Interview Questions

JSON Interview Questions

JS Interview Questions

JavaScript Tutorial and Guide

JavaScript is cross-platform and open-source. It is designed to create web applications and is very easy to understand and learn because it uses HTML.

JavaScript is the most popular client-side scripting language used for web applications. All browsers support JavaScriptand it is set as default. JIn addition, javascript provides full integration with CSS and HTML.

Why do we need to learn JavaScript?

JavaScript is a scripting language different from java and is used as a frontend language. JavaScript uses HTML and CSS, and most browsers implement JavaScript. JSP javascript can be used in-game, app, and desktop application development. JavaScript has many frameworks like react, jQuery, and Angular.

1) JavaScript: JavaScript is used to program the behavior of the web pages and what data we need to display to the user.
2) CSS: We used to specify the webpages' design or layout and how they will display to the user.
3) HTML: is used to define the content of the web pages. It displays the data which extracts from the business logic.

• It allows us to store our data in local storage for further use.
• We can also send a request to the server.
• It can also show the dynamic user contact depending on our business logic or requirement.
• It is also used for animation effects like sound and movement.
Finally,
• JavaScript provides us with various events depending on actions like keypresses, mouse click events, and pointer movement.

Applications of JavaScript

  • Presentations: JavaScript is used to create presentations that give our website an interactive look and make it user-friendly. JavaScript provides libraries to implement these presentations i.e., BespokeJS and RevealJS. We can use these libraries to build web-based presentations.
  • User Notifications: JavaScript is used to provide notifications to users. It provides us with dynamic notifications on the web pages.
  • Server Applications: JavaScript is an event-based library used to build scalable and fast applications.
  • Manipulating HTML: Using JavaScript, we can modify the HTML pages. Using JavaScript, we can easily delete or add any HTML tag depending upon the requirement, providing the look and feels of our application.
  • Client-side validation: JavaScript provides us with validated data at the client side only. So before submitting user input and sending them to the server side, we can pre-validate our data using JavaScript libraries.
  • Back-end Data Loading: In JavaScript, we use ajax calls to load data from the backend. This can be done while we are doing some other task or any other data processing.

Example

Code:

<!DOCTYPE html>
<html>
<body>
<h2> Javascript demo program </h2>
<button type="button"
onclick="document.getElementById('demo1').innerHTML = Date()">
Press me! I will display the current date and time.</button>
<p id="demo1"></p>
</body>
</html>

Output:

Java Demo Program

Prerequisites

Any programmer with a basic understanding of HTML and CSS with added advantage if they have some knowledge of the object-oriented programming language.

Target Audience

We have created this article for beginners to make them understand how to create dynamic web pages.

Footer

Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Company
  • About us
  • Alumni Speak
  • Contact Us
  • Log in
  • Sign up
Work with us
  • Careers
  • Become an Instructor
EDUCBA for Enterprise
  • Enterprise Solutions
  • Explore Programs
  • Free Courses
  • Free Tutorials
  • EDUCBA at Coursera
  • EDUCBA at Udemy
Resources
  • Blog
  • Self-Paced Training
  • ExamTurf
  • Verifiable Certificate
  • Popular Skills Catalogue
  • Exam Prep Catalogue
Popular Categories
  • Lifetime Membership
  • All in One Bundles
  • Featured Skills
  • New & Trending
  • Fresh Entries
  • Finance
  • Data Science
  • Programming and Dev
  • Excel
  • Marketing
  • HR
  • PDP
  • VFX and Design
  • Project Management
  • Exam Prep
  • Learning Paths @ $49
  • All Courses
  • Terms & Conditions
  • Disclaimer
  • Privacy Policy & Cookie Policy
  • Shipping Policy

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

EDUCBA

EDUCBA
Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Web Development & many more.

EDUCBA

EDUCBA Login

🚀 Limited Time Offer! - 🎁 ENROLL NOW