Programming Scripts Articles

Page 5 of 33

What is availHeight property in JavaScript?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 133 Views

The screen.availHeight property returns the available height of the user's screen in pixels, excluding areas occupied by the taskbar, dock, or other system interfaces. Syntax screen.availHeight Return Value Returns a number representing the available screen height in pixels, excluding system UI elements like taskbars. Example Here's how to use the screen.availHeight property to get the available screen height: Screen Available Height ...

Read More

What is the role of special characters in JavaScript Regular Expressions?

V Jyothi
V Jyothi
Updated on 15-Mar-2026 336 Views

Special characters in JavaScript regular expressions are metacharacters that define patterns for matching text. These characters control how many times a character or group should appear and where it should be positioned within a string. Quantifiers Quantifiers specify how many times the preceding character or group should match: Character Description + Matches one or more occurrences of the preceding character * Matches zero or more occurrences of the preceding character ? Matches zero or one occurrence of the preceding character {n} Matches exactly n ...

Read More

Match any string containing a sequence of two to three p's.

Akshaya Akki
Akshaya Akki
Updated on 15-Mar-2026 159 Views

To match any string containing a sequence of two to three p's with JavaScript RegExp, use the p{2, 3} quantifier. This pattern matches exactly 2 or 3 consecutive occurrences of the letter "p". Syntax /p{2, 3}/flags Where {2, 3} specifies the minimum (2) and maximum (3) number of consecutive p's to match. Example: Matching 2-3 Consecutive p's JavaScript Regular Expression var str = "apple pepper hippopotamus p programming"; ...

Read More

How to access document properties using W3C DOM method?

Sravani S
Sravani S
Updated on 15-Mar-2026 232 Views

The W3C DOM (Document Object Model) provides standardized methods to access and manipulate HTML document properties. Unlike browser-specific approaches, W3C DOM methods work consistently across all modern browsers. Common W3C DOM Methods The most frequently used methods for accessing document properties include: getElementById() - Gets element by its ID attribute getElementsByTagName() - Gets elements by tag name getElementsByClassName() - Gets elements by class name querySelector() - Gets first element matching CSS selector Example: Accessing Document Properties Here's how to access various document properties using W3C DOM methods: ...

Read More

Match any single character outside the given set.

Rama Giri
Rama Giri
Updated on 15-Mar-2026 150 Views

To match any single character outside the given set with JavaScript RegExp, use the [^...] metacharacter. The caret ^ inside square brackets creates a negated character class that matches any character NOT in the specified set. Syntax /[^characters]/flags Where characters are the characters you want to exclude from matching. Example: Matching Characters Outside a Set JavaScript Regular Expression var myStr = "Welcome!"; var ...

Read More

How to get the list of document properties which can be accessed using W3C DOM?

Ramu Prasad
Ramu Prasad
Updated on 15-Mar-2026 275 Views

The Document Object Model (DOM) provides several key properties that allow you to access and manipulate different parts of an HTML document. These properties are standardized by the W3C and are available across all modern browsers. Core Document Properties Here are the essential document properties you can access using the W3C DOM: Property Description & Example ...

Read More

How to return a number indicating the Unicode value of the character?

Alankritha Ammu
Alankritha Ammu
Updated on 15-Mar-2026 429 Views

The charCodeAt() method returns a number indicating the Unicode value of the character at the given index. Unicode code points range from 0 to 1, 114, 111. The first 128 Unicode code points are a direct match of the ASCII character encoding. Syntax string.charCodeAt(index) Parameters index − An integer between 0 and 1 less than the length of the string; if unspecified, defaults to 0. Return Value Returns a number representing the Unicode code point of the character at the specified index. If the index is ...

Read More

How to get the innerHTML of a cell with JavaScript DOM?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 8K+ Views

In this tutorial, we will learn how to get the innerHTML of a cell with JavaScript DOM. The innerHTML property allows us to access the HTML content inside table cells by first accessing the table structure through the DOM. We can manipulate the DOM (Document Object Model) easily using document.getElementById(). This method returns the element object that represents the element whose id is specified in the parameter. Since every element's id is unique, we can easily access specific table elements and then use the innerHTML property to retrieve the content of table cells. Using Table Cells Collection ...

Read More

How can I simplify the usage of Regular Expressions with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 397 Views

In this tutorial, we will learn to simplify the use of regular expressions in JavaScript. Regular expressions, also called Regex or RegExp, are sequences of characters that define search patterns. They can be simple or complex and work across many programming languages. Let's understand the need for regular expressions with a practical example. Why Should We Use Regular Expressions? Suppose you're developing an application that collects user emails. Users can enter anything in the input field, potentially creating spam records in your database. You need to validate emails before form submission. To validate an email, you ...

Read More

With JavaScript DOM delete rows in a table?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 6K+ Views

To delete rows in a table in JavaScript, use the DOM deleteRow() method. This method removes a row from a table by specifying its index position. Syntax table.deleteRow(index) Parameters The index parameter specifies which row to delete (0-based indexing). Use -1 to delete the last row. Example: Delete Rows One by One The following example shows how to delete table rows. Each click removes the first row: function deleteFirstRow() { ...

Read More
Showing 41–50 of 328 articles
« Prev 1 3 4 5 6 7 33 Next »
Advertisements