Javascript Data Types

It provides different data types to hold different types of values. There are two types of data types in Javascript. Primitive data types. Non-primitive data types. As we know that JavaScript is a dynamic type language, which means we don’t need to specify type...

Javascript Operators

In JavaScript operators are symbol that are used to perform operations on operands. In simple words 3+2 is equal to 5. Here 3 and 2 are called operands and + is called the operator. Following are the operators used in JavaScript: Arithmetic Operators. Comparison...

Javascript If Else

JavaScript use a conditional statement which is used to perform different tasks according to the conditions. There are three forms of statements use in JavaScript. if Statement. if else Statement. if else if Statement. if statement The if statement is used in...

Javascript Switch Statement

The switch statement is used in JavaScript to execute one code in multiple conditions. It is same as else if statement but it is more convenient then repeated if..else..if statement. Syntax switch (expression)   {   case 1: statement(s)   break;  ...

JavaScript Function

An important part of JavaScript is the ability to create new functions within <script>…..</script> tag. To declare a function in JavaScript using function keyword. We call JavaScript function multiple times to reuse the code. Advantages of JavaScript...

Javascript Object

An object is an entity having state and behavior. JavaScript is an object oriented scripting language. JavaScript is template based not class based but we can create object directly. Syntax to add property to add object objectName.objectProperty = propertyValue; 123...

Javascript array

Array are used to represent the group of elements into a single unit or consecutive memory location. Each and every element which is entering into the array is going to be stored in the array with the unique index starting from zero. Through the using of index we can...

Javascript String

String object works with series of characters. It is used to store and manipulate text. There are two ways to create string in JavaScript: String literal. Using new keyword. String literal By using double quotes string literal is created. Syntax...

Javascript Date

JavaScript Date In JavaScript Date Object is data type build into the JavaScript language. Data object are created with the new Date(). JavaScript Date instance that represents a single moment in time. JavaScript date object can only be instantiated by calling...

Javascript Math

JavaScript Math Math is build-in object that has properties and methods for mathematical constants and functions. It allows you to perform mathematical tasks on numbers. Syntax varpi_val = Math.PI; varsin_val = Math.sin(30); Examples Math.pow() Math.pow(x,y) returns...

Javascript Number

The Number object is a wrapper object which allows you to work with numerical values. The number object is created using the Number() constructor.It may be integer or floating-point. Syntax var n=new Number(value); 123  var n=new Number(value);  Examples...

Javascript Dialog Box

JavaScript Dialog Box A JavaScript dialog box is predefined function which is used to perform different task. Some functions are used in JavaScript Dialog box. Function Description alert() To give alert message to user prompt() To input value from used Confirm() To...

Javascript Window Object

JavaScript Window Object The window object represents a window in browser. An object of window is created automatically by the browser. Window is the object of browser, it is not the object of JavaScript. The JavaScript objects are string, array, data etc. It is used...

Javascript Document Object

JavaScript Document Object Document object represents the whole HTML documents. When HTML document is loaded in browser it becomes the document object. It is the root elements that represent the HTML documents. With the help of document object, we can add dynamic...

Javascript Event

JavaScript Events Events are things that happen, usually user action, that are associated with an object. All object have properties and methods. Some objects also have events. The event handler is a command that is used to specify actions in response to an event....

Javascript Cookies

JavaScript Cookies Cookie is a piece of data which is sent from a website and stored locally by the user’s browser. Cookie is needed because HTTP is stateless protocol. Today most of the websites uses cookie. Cookies is the most efficient method of remembering...

Javascript getElementByID

JavaScript getElementById The document.getElementById() method returns the element of specified id. In below example we receive input field by using document.getElementById() method, here document.getElementById() receive input value on the basis of input field id....

Javascript Forms Validation

JavaScript Forms Validation Form validation works at server, after client had entered all the necessary details and then pressed submit button. JavaScript provides the facility to validate the form on the client side so processing will fasterthan server-side...

Javascript Email Validation

JavaScript Email validation We can validate the email with the help of JavaScript. Here we check the condition related to any email id, like email it must have “@” and “.” sign and also email id must be atleast 10 character. There are many...

Javascript Password Validation

JavaScript Password Validation Here we see that how to validate any password field. Like password field can be blank and length of password is minimum 8 characters. Example <!DOCTYPE html>   <html>   <head>   <script>  ...

Pin It on Pinterest