Sreemaha

Sreemaha

51 Articles Published

Articles by Sreemaha

51 articles

How to specify the URL of the resource to be used by the object in HTML?

Sreemaha
Sreemaha
Updated on 16-Mar-2026 195 Views

The data attribute in HTML is used to specify the URL of the resource to be used by the element. This attribute defines the location of external content such as images, videos, audio files, Flash files, PDFs, or other multimedia resources that should be embedded in the web page. Syntax Following is the syntax for the data attribute − Alternative content The data attribute accepts a valid URL pointing to the resource file. The URL can be relative (pointing to a file in the same domain) or absolute ...

Read More

How to set the audio output of the video to mute in HTML?

Sreemaha
Sreemaha
Updated on 16-Mar-2026 452 Views

Use the muted attribute to set the audio output of the video to mute in HTML. The muted attribute is a boolean attribute that specifies whether the video's audio should be initially silenced when the page loads. Syntax Following is the syntax for the muted attribute − The muted attribute can be written in three ways − muted − Boolean attribute (recommended) muted="muted" − Explicit value muted="" − Empty value How It Works When the muted attribute is present, the video element will start ...

Read More

How to create HTML link that doesnt follow the link?

Sreemaha
Sreemaha
Updated on 16-Mar-2026 457 Views

The nofollow attribute in HTML creates a link that doesn't pass SEO authority to the target page. When you add rel="nofollow" to a link, it tells search engines not to follow the link or transfer any ranking credit to the destination website. Syntax Following is the syntax to create a nofollow link − Link Text The rel attribute specifies the relationship between the current document and the linked document. When set to "nofollow", it instructs search engines not to follow the link. Understanding Nofollow Links The rel="nofollow" attribute serves several purposes − ...

Read More

Checking if a key exists in HTML5 Local Storage

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

In HTML5 Local Storage, checking if a key exists is essential for avoiding errors and handling data appropriately. There are several methods to determine whether a specific key is present in localStorage before attempting to retrieve or manipulate its value. Syntax Following are the common syntaxes for checking if a key exists in localStorage − // Method 1: Using getItem() if (localStorage.getItem("keyName") !== null) { // key exists } // Method 2: Using 'in' operator if ("keyName" in localStorage) { // key exists } // Method ...

Read More

HTML 5 local Storage size limit for sub domains

Sreemaha
Sreemaha
Updated on 16-Mar-2026 709 Views

HTML5's localStorage provides a way to store data locally in the user's browser. However, it comes with size limitations to prevent abuse and ensure browser performance. The standard size limit is typically 5 to 10 MB per origin, with most browsers implementing a 5 MB limit. Understanding Origins and Subdomains In web storage context, an origin consists of the protocol, domain, and port. Each origin gets its own separate localStorage space. Importantly, subdomains are treated as separate origins, meaning subdomain1.example.com and subdomain2.example.com each have their own 5 MB storage limit. localStorage Origins and Size ...

Read More

Execute a script when the media is ready to start playing in HTML?

Sreemaha
Sreemaha
Updated on 16-Mar-2026 197 Views

The oncanplay event in HTML is triggered when the browser has enough data to start playing a media element (audio or video) but may need to stop for further buffering. This event is essential for executing scripts when media becomes playable. Syntax Following is the syntax for the oncanplay event attribute − ... ... You can also use the addEventListener method in JavaScript − element.addEventListener("canplay", function() { // Your code here }); Using oncanplay with Video Element The oncanplay event is commonly used with video ...

Read More

Style Rules in CSS

Sreemaha
Sreemaha
Updated on 15-Mar-2026 6K+ Views

CSS comprises of style rules interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts − Selector - A selector is an HTML tag at which a style will be applied. This could be any tag like or etc. Property - A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc. Value - Values assigned to properties. For ...

Read More

Create JS Radial gradient with matrix in HTML

Sreemaha
Sreemaha
Updated on 15-Mar-2026 313 Views

JavaScript radial gradients with matrix transformations allow you to create scaled and transformed gradient effects on HTML canvas elements. This technique combines gradient creation with matrix scaling operations. HTML Structure First, create a canvas element with CSS styling: canvas { background-color: purple; border: 1px solid #ccc; } Creating Radial Gradient with Matrix Here's how to create a radial gradient with matrix scaling applied: // Get canvas and 2D context var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); // ...

Read More

What is onmouseleave event in JavaScript?

Sreemaha
Sreemaha
Updated on 15-Mar-2026 335 Views

The onmouseleave event triggers when the mouse pointer moves out of an element. It fires only when the mouse completely leaves the element boundary. Syntax element.onmouseleave = function() { // Code to execute when mouse leaves }; // Or using addEventListener element.addEventListener('mouseleave', function() { // Code to execute }); Example: Basic Mouse Leave Event Here's how to implement the onmouseleave event: function sayHello() { ...

Read More

Usage of background property in CSS

Sreemaha
Sreemaha
Updated on 15-Mar-2026 115 Views

The background property in CSS is a shorthand property that allows you to set multiple background-related properties in a single declaration. It can include background color, image, position, size, repeat behavior, and attachment. Syntax background: [color] [image] [repeat] [attachment] [position] / [size]; Individual Background Properties The background shorthand can include any combination of these properties: background-color - Sets the background color background-image - Sets the background image background-repeat - Controls image repetition background-attachment - Controls scrolling ...

Read More
Showing 1–10 of 51 articles
« Prev 1 2 3 4 5 6 Next »
Advertisements