HTML Articles

Page 121 of 151

How can I access document properties using Legacy DOM method in JavaScript?

Srinivas Gorla
Srinivas Gorla
Updated on 15-Mar-2026 243 Views

To access document properties using Legacy DOM methods in JavaScript, you can use various built-in properties and collections that provide information about the document structure and content. Common Legacy DOM Properties The Legacy DOM provides several properties to access document information: document.title - Gets the document title document.URL - Gets the complete URL document.forms - Collection of all forms document.images - Collection of all images document.links - Collection of all links Example Document Title ...

Read More

With JavaScript RegExp find a character except newline?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 294 Views

To find a character except for a newline, use the dot metacharacter . (period). The dot matches any single character except the newline character (). Syntax /./ // Matches any character except newline /.+/ // Matches one or more characters except newline /a.b/ // Matches 'a', any character, then 'b' Example JavaScript Regular Expression ...

Read More

How objects are organized in a web document? How is it arranged in a hierarchy?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 281 Views

The objects in a web document are organized in a hierarchical structure called the Document Object Model (DOM). This hierarchy represents the relationship between different elements and allows JavaScript to interact with web page components systematically. DOM Hierarchy Structure The DOM follows a tree-like structure where each object has a specific position and relationship with other objects: Window object − Top of the hierarchy. It represents the browser window and is the global object for all JavaScript operations. ...

Read More

What are the document methods supported by Legacy DOM?

Priya Pallavi
Priya Pallavi
Updated on 15-Mar-2026 173 Views

The Legacy DOM provided several document methods for manipulating document content. While most are deprecated in modern web development, understanding them helps with legacy code maintenance. Legacy DOM Document Methods Method Description & Usage clear() Deprecated - Erased document contents and returned nothing. Example: document.clear() close() Closes a document stream opened with open() method. Example: document.close() open() Deletes existing content and opens a stream for new content. Example: document.open() write() Inserts strings into the document during parsing or after open(). Example: document.write("Hello World") ...

Read More

With JavaScript Regular Expression find a non-whitespace character.

Daniol Thomas
Daniol Thomas
Updated on 15-Mar-2026 501 Views

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 More

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

V Jyothi
V Jyothi
Updated on 15-Mar-2026 331 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

With JavaScript RegExp search a carriage return character.

Ayyan
Ayyan
Updated on 15-Mar-2026 748 Views

To find carriage return characters with JavaScript Regular Expression, use the \r metacharacter. This pattern matches the carriage return character (ASCII code 13) in strings. Syntax /\r/ Example: Finding Carriage Return Position The following example shows how to search for a carriage return character and return its position in the string: JavaScript Regular Expression ...

Read More

How to access document properties using W3C DOM method?

Sravani S
Sravani S
Updated on 15-Mar-2026 225 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

What is availHeight property in JavaScript?

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 125 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

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

Ramu Prasad
Ramu Prasad
Updated on 15-Mar-2026 269 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
Showing 1201–1210 of 1,509 articles
« Prev 1 119 120 121 122 123 151 Next »
Advertisements