Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Sharon Christine
Page 5 of 34
HTML DOM Input Number max Property
The HTML DOM input number max property returns and modifies the value of the max attribute of an input field with type="number". This property sets the maximum allowed value for the number input field. Syntax Following is the syntax for getting the max value − object.max Following is the syntax for setting the max value − object.max = "number" Parameters The max property accepts a single parameter − number − A string representing the maximum value allowed for the number input. It can be an integer or ...
Read MoreHTML DOM Input Number min Property
The HTML DOM Input Number min property gets and sets the value of the min attribute of a number input field. This property defines the minimum value that can be entered in a number input element, providing client-side validation for numeric inputs. Syntax Following is the syntax for returning the min value − object.min Following is the syntax for setting the min value − object.min = "number" Parameters number − A string or numeric value representing the minimum allowed value for the input field. ...
Read MoreHTML DOM Select multiple Property
The HTML DOM select multiple property sets or returns whether multiple options can be selected from a drop-down list. When enabled, users can select multiple options by holding Ctrl (Windows) or Cmd (Mac) while clicking, or by using Shift to select a range. Syntax Following is the syntax for returning the multiple property − object.multiple Following is the syntax for setting the multiple property − object.multiple = true | false Property Values Value Description true Allows multiple options to be selected from ...
Read MoreHTML DOM Select name Property
The HTML DOM Select name property returns and modifies the value of the name attribute of a dropdown list (select element) in an HTML document. This property is essential for form data processing and server-side identification of form elements. Syntax Following is the syntax for returning the name property − object.name Following is the syntax for modifying the name property − object.name = "text" Parameters text − A string value that specifies the new name for the select element. Return Value The property returns a ...
Read MoreHTML DOM Select value Property
The HTML DOM select value property is used to get or set the value of the selected option in a dropdown list. This property returns the value of the currently selected option or allows you to programmatically select an option by setting its value. Syntax Following is the syntax for returning the selected value − selectObject.value Following is the syntax for setting the selected value − selectObject.value = "optionValue" Return Value The property returns a string representing the value of the currently selected option. If no value attribute is ...
Read MoreHTML DOM paddingLeft Property
The HTML DOM paddingLeft property is used to get or set the left padding of an HTML element. This property allows you to dynamically modify the spacing inside an element from the left side using JavaScript. Syntax Following is the syntax for getting the paddingLeft property − object.style.paddingLeft Following is the syntax for setting the paddingLeft property − object.style.paddingLeft = "value" Return Value The paddingLeft property returns a string representing the left padding value of the element, including the unit (e.g., "20px", "2em", "5%"). Property Values The ...
Read MoreWhere should I put tags in HTML markup?
JavaScript code in HTML is placed between and tags. You can place them inside the , within the , or just before the closing tag. The recommended approach is placing scripts before so page content loads first. The tag tells the browser to interpret the content as a script. The type="text/javascript" attribute is optional in modern browsers as JavaScript is the default. Where to Place Tags In Loads before page renders In ...
Read MoreRemoving an element from an Array in Javascript
Removing an element from an array in Javascript can be achieved using various approaches. Removal of an element can be done from the beginning, end or from any specific position. We will be understanding various approaches for removing elements from an array in Javascript based on our needs. In this article, we are working with an array of numbers and our task is to remove elements from an array in Javascript using different methods. ...
Read MoreJoining two Arrays in Javascript
In JavaScript, there are multiple ways to join two arrays. The method you choose depends on whether you want to create a new array or modify an existing one. Using concat() Method (Creates New Array) The concat() method creates a new array without modifying the original arrays: let arr1 = [1, 2, 3, 4]; let arr2 = [5, 6, 7, 8]; let arr3 = arr1.concat(arr2); console.log("Original arr1:", arr1); console.log("Original arr2:", arr2); console.log("New combined array:", arr3); Original arr1: [1, 2, 3, 4] Original arr2: [5, 6, 7, 8] New combined array: [1, 2, ...
Read MoreSearching an element in Javascript Array
JavaScript provides several methods to search for elements in arrays. Each method has its own use case depending on whether you're searching for primitive values or complex objects. Using indexOf() for Primitive Values The indexOf() method searches through the array and returns the index of the first matching element, or -1 if not found. let people = ["Harry", "Martha", "John", "Sam"]; console.log(people.indexOf("John")); console.log(people.indexOf("Jim")); 2 -1 Using find() for Complex Objects The find() method returns the first element that matches the condition provided in the callback function. let people ...
Read More