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 on Trending Technologies
Technical articles with clear explanations and examples
Why JavaScript Data Types are Dynamic?
JavaScript is a dynamically typed language, which means variables can hold different data types during program execution. Unlike statically typed languages where you must declare a variable's type upfront, JavaScript determines the type at runtime based on the assigned value. What Does Dynamic Typing Mean? In JavaScript, you don't need to specify whether a variable will store a string, number, or boolean. The same variable can be reassigned to hold completely different data types throughout the program. Example var val; ...
Read MoreWhich is the JavaScript RegExp to find any alternative text?
To match any of the specified alternatives in JavaScript, use the alternation operator | within parentheses. This pattern allows you to find multiple possible text options in a single regular expression. Syntax (option1|option2|option3) The pipe symbol | acts as an OR operator, matching any one of the alternatives listed within the parentheses. Example Here's how to find alternative text patterns using JavaScript RegExp: JavaScript Regular Expression var myStr = "one, ...
Read MoreSet the Background Attachment with CSS
The background-attachment property controls whether a background image scrolls with the content or remains fixed in the viewport. This CSS property is useful for creating parallax effects or keeping decorative backgrounds stationary. Syntax background-attachment: value; Property Values Value Description scroll Background scrolls with content (default) fixed Background stays fixed in viewport local Background scrolls with element's content Example: Fixed Background This example demonstrates a fixed background that remains stationary while content scrolls: ...
Read MoreBootstrap Form select
A select dropdown is used when you want to allow users to pick from multiple options. By default, it only allows one selection, but can be configured for multiple selections. Use for list options with which users are familiar, such as states, countries, or categories. Use multiple attribute to allow users to select more than one option. Bootstrap's form-control class provides consistent styling across browsers. Basic Select Example Here's a simple Bootstrap form with a select dropdown: ...
Read MoredecodeURIComponent() function in JavaScript
The decodeURIComponent() function accepts a string value representing an encoded URI (Uniform Resource Identifier), decodes it, and returns the result. It reverses the encoding done by encodeURIComponent(). Syntax decodeURIComponent(encodedURI) Parameters encodedURI: A string representing an encoded URI component that you want to decode. Return Value Returns a new string representing the decoded version of the given encoded URI component. Example JavaScript Example var encodedData = encodeURIComponent('http://www.qries.com/?x=шеллы'); ...
Read MoreHow to find the name and the target of a form in JavaScript?
In JavaScript, you can access the name and target attributes of HTML forms using DOM properties. These attributes help identify forms and control where form submissions open. The name attribute provides a unique identifier for the form, while the target attribute specifies where to display the response after form submission. Common target values include _self (same window), _blank (new window), _parent, and _top. Syntax To access form properties, use the following syntax: // Get form name document.getElementById('formId').name; // Get form target document.getElementById('formId').target; Example 1: Getting Form Name This example demonstrates how ...
Read MoreHow to find keys of a hash in JavaScript?
In JavaScript, objects act as hash tables where you can store key-value pairs. To extract all keys from an object, use the built-in Object.keys() method, which returns an array of the object's property names. Syntax Object.keys(object) Parameters object: The object whose keys you want to retrieve. Return Value Returns an array of strings representing the object's own enumerable property names (keys). Example Find Hash Keys ...
Read MoreJavaScript get row count of an HTML table
Tables are a common way to organize and display data in HTML. If you're working with tables dynamically in JavaScript, you might need to count the rows in an HTML table for various purposes, such as validation, manipulation, or displaying statistics. In this article, we will demonstrate how to retrieve the row count of an HTML table using JavaScript. We will use the rows property to access the row count through rows.length, and also show how to count rows in specific table sections like . Understanding the rows Property The rows property in JavaScript provides access to ...
Read MoreHow to create Empty Values String in JavaScript?
In JavaScript, there are several ways to create empty string values. An empty string is a string with zero characters, represented by two quotation marks with nothing between them. Syntax let emptyString = ""; // Double quotes let emptyString = ''; // Single quotes let emptyString = ``; // Template literals let emptyString = String(); // String constructor Example: Creating Empty Strings ...
Read MoreHow to perform Multiline matching with JavaScript RegExp?
To perform multiline matching in JavaScript, use the m flag with regular expressions. This flag makes ^ and $ anchors match the beginning and end of each line, not just the entire string. Syntax /pattern/m new RegExp("pattern", "m") How the m Flag Works Without the m flag, ^ matches only the start of the string and $ matches only the end. With the m flag, they match line boundaries created by (newline) characters. Example: Basic Multiline Matching JavaScript Regular ...
Read More