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
HTML Articles
Page 121 of 151
How can I access document properties using Legacy DOM method in JavaScript?
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 MoreWith JavaScript RegExp find a character except newline?
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 MoreHow objects are organized in a web document? How is it arranged in a hierarchy?
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 MoreWhat are the document methods supported by Legacy DOM?
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 MoreWith 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 MoreWhat is the role of special characters in JavaScript Regular Expressions?
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 MoreWith JavaScript RegExp search a carriage return character.
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 MoreHow to access document properties using W3C DOM method?
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 MoreWhat is availHeight property in JavaScript?
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 MoreHow to get the list of document properties which can be accessed using W3C DOM?
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