Articles on Trending Technologies

Technical articles with clear explanations and examples

HTML DOM activeElement Property

Ankith Reddy
Ankith Reddy
Updated on 16-Mar-2026 244 Views

The HTML DOM activeElement property is a read-only property that returns the currently focused element in the document. This property is useful for tracking user interaction and determining which element has keyboard focus at any given time. When no specific element has focus, the activeElement property typically returns the element or the element, depending on the browser. Syntax Following is the syntax for the activeElement property − document.activeElement Return Value The activeElement property returns an Element object representing the currently focused element in the document. If no element has focus, ...

Read More

How do we add a sample computer code in HTML?

seetha
seetha
Updated on 16-Mar-2026 214 Views

Use the tag to display a sample computer code. The HTML tag is used to display the output of a computer program or sample text that would appear on a computer screen, such as command-line output, error messages, or program responses. Syntax Following is the syntax for the tag − Sample computer output The tag is an inline element that typically displays its content in a monospace font, making it visually distinct from regular text. Basic Example Following example shows how to use the tag to display ...

Read More

How to create a section in a document in HTML?

Jennifer Nicholas
Jennifer Nicholas
Updated on 16-Mar-2026 10K+ Views

Use the tag to add a section in a document. The HTML tag is used for defining a section of your document. With the div tag, you can group large sections of HTML elements together and format them with CSS. Syntax Following is the basic syntax for the tag − Content goes here The tag is a block-level container element that creates a rectangular section on the page. It serves as a wrapper for other HTML elements and provides a way to apply CSS styles ...

Read More

Menu not visible in IE8. How to make it visible with HTML?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 16-Mar-2026 160 Views

Internet Explorer 8 has specific compatibility issues with CSS properties that can cause navigation menus to become invisible. The most common cause is improper use of the opacity property, which requires special handling in IE8 to ensure cross-browser compatibility. The Problem When CSS stylesheets use modern opacity syntax without fallbacks, menus may appear invisible in Internet Explorer 8. This occurs because IE8 uses proprietary filter syntax for transparency effects instead of the standard opacity property. Syntax Following is the cross-browser compatible syntax for opacity in IE8 − .element { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; ...

Read More

HTML5 Canvas & z-index issue in Google Chrome

Chandu yadav
Chandu yadav
Updated on 16-Mar-2026 880 Views

When working with HTML5 Canvas elements in Google Chrome, a specific rendering issue occurs when applying z-index to a canvas with position: fixed. This bug causes Chrome to improperly render other fixed-position elements on the page, but only when the canvas dimensions exceed 256×256 pixels. The issue manifests as visual glitches or disappearing elements that also have position: fixed applied. This is a browser-specific problem that primarily affects Google Chrome and can significantly impact layout stability in web applications using large fixed canvases. The Problem The rendering issue occurs due to Chrome's internal optimization mechanisms when handling ...

Read More

How to set what browsers will show that do not support the ruby element?

V Jyothi
V Jyothi
Updated on 16-Mar-2026 208 Views

The HTML tag specifies what browsers will show when they do not support the element. Ruby annotations are used in East Asian typography to provide pronunciation guides or semantic information for characters, commonly seen in Japanese furigana and Chinese pinyin. Syntax Following is the syntax for the tag − base_text fallback_openannotationfallback_close The (ruby parentheses) element contains fallback text that displays in browsers without ruby support. Modern browsers that support ruby annotations hide the content inside tags, while older browsers display it as regular text. ...

Read More

Same origin policy on mobile apps with HTML

George John
George John
Updated on 16-Mar-2026 332 Views

The same-origin policy is a critical web security concept that restricts how a document or script from one origin can interact with resources from another origin. However, when developing mobile applications using HTML, CSS, and JavaScript through frameworks like PhoneGap (Apache Cordova), the same-origin policy behaves differently than in traditional web browsers. Same-Origin Policy in Web Browsers vs Mobile Apps In web browsers, the same-origin policy prevents scripts from accessing content from different domains, protocols, or ports. However, in mobile apps built with HTML/JavaScript frameworks, the application runs locally on the device using the file:// protocol rather than ...

Read More

HTML autocomplete Attribute

Ankith Reddy
Ankith Reddy
Updated on 16-Mar-2026 206 Views

The autocomplete attribute in HTML controls whether the browser should automatically fill in form fields based on previously entered values. When set to on, browsers provide suggestions from the user's input history, making form completion faster and more convenient. Syntax Following is the syntax for the autocomplete attribute − For individual form controls, the syntax is − Parameters The autocomplete attribute accepts the following values − on − Enables autocomplete for the form or input element. The browser will suggest previously ...

Read More

How to store data in the browser with the HTML5 localStorage API?

Daniol Thomas
Daniol Thomas
Updated on 16-Mar-2026 316 Views

HTML5 localStorage is a web storage API that allows you to store data directly in the user's browser. Unlike sessionStorage, which expires when the browser tab is closed, localStorage data persists indefinitely until explicitly removed by the user or the application. The localStorage API provides a simple way to store key-value pairs as strings in the browser. This feature is particularly useful for saving user preferences, form data, application state, or any data that should persist across browser sessions. Syntax Following is the syntax for storing data in localStorage − localStorage.setItem(key, value); localStorage.key = value; ...

Read More

Change colour of an image drawn on an HTML5 canvas element.

radhakrishna
radhakrishna
Updated on 16-Mar-2026 2K+ Views

In order to change the color of an image drawn on an HTML5 Canvas element, you need to manipulate the pixel data of the image. This is achieved by using the drawImage() method to draw the image onto the canvas, then accessing and modifying the pixel data using getImageData() and putImageData() methods. Syntax Following is the syntax for drawing an image on canvas − ctx.drawImage(image, x, y); Following is the syntax for getting image data − var imageData = ctx.getImageData(x, y, width, height); Following is the syntax for putting modified ...

Read More
Showing 13901–13910 of 61,297 articles
Advertisements