In this tutorial, we will discuss the rules to follow for Object Definitions in JavaScript. JavaScript is an object-oriented scripting language. An object contains many properties. The property consists of a key and a value. The property is known as a method when this value is a function. Predefined objects are available in the browser. We can also define our objects. A real-life example of an object is a cup. The color, design, weight, and material are the main properties of a cup. The object name and the property name are case-sensitive. To define a property, we need to assign ... Read More
In this tutorial, we will learn how we can fill columns with JavaScript. Use the columnFill property to fill columns. Fill it as auto to fill sequentially, or balance to equally divide content between columns. The columnFill property is the property that specifies how the columns should be filled, auto, balanced, or in any other manner. Syntax Following is the syntax to set the columnFill property in JavaScript − selectedElement.style.columnFill="value"; Here the selectedElement is the element to which you want to add the columnFill property, while using style is the way of adding any CSS property to an element ... Read More
In this tutorial, we will discuss the properties of the window.screen object in JavaScript. The window comes under the Browser Object Model – BOM. The window's screen object holds information on the user's screen. Because the scope of the window object is high, we can also write the window's screen object as "screen". There are no direct methods for the screen object. The object's use is to improve the UI experience of a webpage. Properties of window.screen Object availHeight The availHeight property returns the screen height, excluding the Windows Taskbar. availWidth The availWidth property returns the screen width, excluding the ... Read More
In this tutorial, we will learn how to print all methods of an object in JavaScript. An object's property with a function declaration is known as a JavaScript method. Methods are represented as object attributes and functions. We refer to actions carried out on objects as JavaScript methods. It is also possible to call the objects without using parentheses. This is a reference to the method's owner object. The method manipulates data that is part of a Class. The Object that was called into a method is implicitly passed. A function connected to an object attribute is called a method. ... Read More
In this tutorial, let us discuss how to work with document.forms in JavaScript. The document.form property returns all the form tags in the document. The forms property is read-only. The form property is the Dom level 1 feature. Working with form attributes and elements Here let us learn to work with a form's properties, attributes, and elements. Users can follow the syntax below to work with the form's properties and elements. Syntax var forms = document.forms; let formLen = forms.length; let formId = forms[0].id || forms.item(0).id; let formItemId = forms[0].elements[0].id; let formItemVal = forms[0].elements[0].value; let formData = forms.namedItem("testForm").innerHTML; The ... Read More
In this tutorial, we will learn to work with document.documentElement property in JavaScript. JavaScript DOM is a JavaScript script that can dynamically read or change the webpage's content. There are numerous properties available in the JavaScript DOM. We can access, change and style every element on the webpage. The document is the property of dom that is the root of the HTML webpage. It again consists of its child properties. The documentElement is the child property of the document property in dom. It is used to get the root element of the document. It returns an object consisting of the ... Read More
In this tutorial, we will learn how to validate an email address using JavaScript. A computer network's electronic mailbox, often known as an email address, is used to send and receive messages. All email addresses have the same format as in the 1980s. The email validation process checks to see if an email address is deliverable and legitimate. It quickly executes an algorithm that detects different typos and also whether there are deliberate misdirection or innocent errors. It verifies like Gmail or Yahoo if a certain email address is registered with such reputable domain or not. This increases the effectiveness ... Read More
In this tutorial, we will learn to validate decimal numbers in JavaScript. A number containing decimal(.) is known as a decimal number. A number comes between the two whole numbers, called decimal numbers. We use decimal numbers in calculations, progress bars, to accept input in forms, etc. A regular expression is a well-known entity for validation purposes. A Regular expression is a search pattern of characters with a specific meaning used to validate the data. It can be used for any string or number. We are going to use it for validation purposes in JavaScript. We used a simple logic ... Read More
In this tutorial, let us discuss how to use the void keyword in JavaScript. We use the void keyword as the return type of function that does not return any value. It evaluates an expression and returns undefined. We can use this with a single operand because this is a unary operator. We should not wrap the expression in parentheses because void is not a function. void 0 is the same as void(0). Users can follow the syntax blocks to deal with each use case. Syntax void expression The expression can be a variable or a function. Use void ... Read More
In this tutorial, let us discuss the methods to use unlimited arguments in a JavaScript function. The number of arguments in a JavaScript function is a bit tricky. If we specify three arguments should follow the correct order of the arguments. Let us discover the solution to this problem by introducing the methods to pass unlimited in a function, we can not pass more than three. Moreover, we arguments to a JavaScript function. Using ES5 Arguments Object Instead of converting the arguments object to an array, we can process the arguments object with the total number of arguments. Follow the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP