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 Daniol Thomas
Page 3 of 13
With JavaScript Regular Expression find a non-whitespace character.
To find a non-whitespace character in JavaScript regular expressions, use the \S metacharacter. This matches any character that is not a space, tab, newline, or other whitespace character. Syntax \S // Matches any non-whitespace character \S+ // Matches one or more non-whitespace characters \S* // Matches zero or more non-whitespace characters Example: Finding Non-Whitespace Characters JavaScript Regular Expression ...
Read MoreHow to get a string representation of a number in JavaScript?
Use the toString() method to get the string representation of a number. This method converts any number to its string equivalent and supports different number bases for advanced use cases. Syntax number.toString() number.toString(radix) Parameters radix (optional): An integer between 2 and 36 representing the base for numeric representation. Default is 10 (decimal). Basic Example var num1 = 25; ...
Read MoreWhat is the maximum size of a web browser's cookies value?
The maximum size of cookies varies across different web browsers. Understanding these limitations is crucial for web developers to ensure proper cookie handling and avoid data loss. Browser Cookie Limits Web Browser Maximum Cookies per Domain Maximum Size per Cookie ...
Read MoreWhat is the difference between == and === in JavaScript?
In JavaScript, == (double equals) performs loose equality comparison with type coercion, while === (triple equals) performs strict equality comparison without type conversion. Double Equals (==) - Loose Equality The == operator converts operands to the same type before comparing them. This can lead to unexpected results: console.log(4 == 4); // true console.log('4' == 4); // true - string converted to number console.log(4 == '4'); // true - number converted to string console.log(0 == false); // ...
Read MoreHow can I pass a parameter to a setTimeout() callback?
To pass a parameter to setTimeout() callback, you can use additional arguments after the delay parameter or use anonymous functions with closures. Syntax setTimeout(functionName, milliseconds, arg1, arg2, arg3...) The following are the parameters: functionName − The function to be executed. milliseconds − The delay in milliseconds. arg1, arg2, arg3 − Arguments passed to the function. Method 1: Using Additional Arguments Pass parameters directly as additional arguments to setTimeout(): Submit ...
Read MorePerform Animation on CSS padding-top property
The CSS padding-top property can be animated using CSS animations or transitions. This creates smooth visual effects where the top padding of an element gradually changes over time. Syntax @keyframes animation-name { from { padding-top: initial-value; } to { padding-top: final-value; } } selector { animation: animation-name duration timing-function iteration-count; } Example: Animating padding-top Property The following example demonstrates how to animate the padding-top property using CSS keyframes − .container { ...
Read MoreCSS voice-range Speech Media property
The CSS voice-range property is used to control the range of pitch variation in speech synthesis. It defines how much the pitch can vary from the base pitch when content is read aloud by screen readers or speech synthesizers. Syntax selector { voice-range: value; } Possible Values ValueDescription x-lowVery narrow pitch range lowNarrow pitch range mediumNormal pitch range (default) highWide pitch range x-highVery wide pitch range frequencySpecific frequency value (e.g., 90Hz) Example: Setting Voice Range with Keywords The following example demonstrates different voice range settings − ...
Read MoreSet the width of the rule between columns with CSS
The CSS column-rule-width property is used to set the width of the rule (line) between columns in a multi-column layout. This property works in conjunction with column-rule-style and column-rule-color to create visual separators between columns. Syntax selector { column-rule-width: value; } Possible Values ValueDescription thinA thin rule (typically 1px) mediumA medium rule (typically 3px) - default value thickA thick rule (typically 5px) lengthA specific width in px, em, rem, etc. Example: Setting Column Rule Width The following example demonstrates how to set different widths for column ...
Read MoreShorthand property to set columns with CSS
The CSS columns property is a shorthand that allows you to set both the column width and column count for multi-column layouts. This property combines column-width and column-count into a single declaration. Syntax selector { columns: column-width column-count; } Possible Values ValueDescription column-widthSpecifies the optimal width for each column (px, em, rem, etc.) column-countSpecifies the number of columns (integer value) autoBrowser determines the value automatically Example The following example creates a 4-column layout with 100px optimal column width and adds styling rules − ...
Read MoreCenter pagination on a web page with CSS
Centering pagination on a web page involves creating a horizontal pagination bar and aligning it to the center of its container. This is commonly achieved using the text-align: center property on the parent container and display: inline-block on the pagination element. Syntax .pagination-container { text-align: center; } .pagination { display: inline-block; } Example The following example demonstrates how to create a centered pagination bar with styled navigation links − ...
Read More