HTML Articles

Page 71 of 151

How to use the formmethod attribute in HTML?

Nancy Den
Nancy Den
Updated on 16-Mar-2026 229 Views

The formmethod attribute in HTML is used to override the default HTTP method specified in a form's method attribute. It is used specifically with elements of type submit and image, allowing different submit buttons within the same form to use different HTTP methods (GET or POST). Syntax Following is the syntax for the formmethod attribute − Where method can be either "get" or "post". Parameters The formmethod attribute accepts the following values − get − Appends form data to the URL as query parameters. Data is visible in ...

Read More

How to use formtarget attribute in HTML?

Krantik Chavan
Krantik Chavan
Updated on 16-Mar-2026 311 Views

The formtarget attribute in HTML specifies where to display the response after submitting a form. This attribute overrides the target attribute of the element and is used only with and elements. Syntax Following is the syntax for the formtarget attribute − Where value can be _blank, _self, _parent, _top, or a custom frame name. Attribute Values The formtarget attribute accepts the following values − Value Description _blank Response gets displayed in a new window or tab _self The ...

Read More

How to play sound file in a web-page in the background?

Smita Kapse
Smita Kapse
Updated on 16-Mar-2026 26K+ Views

The HTML audio element is the modern standard for adding audio to web pages. To play a sound file in the background automatically when a page loads, you can use the element with the autoplay and loop attributes. The element can also be used but is less recommended for modern web development. Syntax Following is the syntax for the HTML audio element − Your browser does not support the audio element. Following is the syntax for the embed element ...

Read More

Why to use canvas tag in HTML5?

Nishtha Thakur
Nishtha Thakur
Updated on 16-Mar-2026 316 Views

The HTML tag is a powerful HTML5 element used to draw graphics, animations, charts, and interactive visual content directly in the browser using JavaScript. Unlike static images, the canvas provides a dynamic drawing surface that can be programmatically controlled to create rich visual experiences. Syntax Following is the basic syntax for the canvas element − Fallback content for browsers that don't support canvas Canvas Attributes The canvas element has two specific attributes that control its dimensions − Attribute Value Description ...

Read More

How to handle Geolocation errors in HTML5?

Krantik Chavan
Krantik Chavan
Updated on 16-Mar-2026 1K+ Views

The HTML5 Geolocation API allows websites to access a user's geographical location with their permission. While this API provides powerful location-aware functionality, geolocation requests can fail due to various reasons such as user denial, network issues, or hardware problems. Proper error handling is essential to provide a good user experience when location services are unavailable. Syntax The geolocation methods use an error callback function to handle failures − navigator.geolocation.getCurrentPosition(successCallback, errorCallback, options); navigator.geolocation.watchPosition(successCallback, errorCallback, options); The error callback receives a PositionError object containing error details. PositionError Object The PositionError object is passed to ...

Read More

How to use HTML5 localStorage and sessionStorage?

Nancy Den
Nancy Den
Updated on 16-Mar-2026 618 Views

HTML5 introduced two powerful mechanisms for storing data on the client side − localStorage and sessionStorage. These storage options overcome the limitations of traditional HTTP cookies by providing larger storage capacity and reducing unnecessary data transmission with every HTTP request. The key advantages of HTML5 web storage over cookies include − No automatic transmission − Storage data is not sent with every HTTP request, improving web application performance. Larger storage capacity − Web storage can hold approximately 5-10 MB of data per domain, compared to cookies' 4 KB limit. Better performance − ...

Read More

How to use splash vector graphics on your Responsive Site?

Rishi Raj
Rishi Raj
Updated on 16-Mar-2026 271 Views

Vector graphics like SVG (Scalable Vector Graphics) are perfect for responsive websites because they maintain crisp quality at any screen size while keeping file sizes small. Unlike raster images that become pixelated when scaled, SVG graphics are resolution-independent and adapt beautifully to different devices and screen densities. SVG files are particularly effective for backgrounds, icons, illustrations, and decorative elements on responsive sites. They load faster than high-resolution bitmap images and provide consistent visual quality across all devices. Why Use SVG for Responsive Design SVG offers several advantages for responsive websites − Resolution independence − SVG ...

Read More

How Server-Sent Events Works in HTML5?

Jai Janardhan
Jai Janardhan
Updated on 16-Mar-2026 500 Views

Server-Sent Events (SSE) is an HTML5 technology that allows a web server to push data to a client automatically. Unlike traditional polling methods, SSE maintains a persistent connection where the server continuously sends updates to the client without requiring repeated requests. How Server-Sent Events Work Server-Sent Events establish a one-way communication channel from server to client. The client opens a connection to the server using the EventSource API, and the server keeps this connection alive to send real-time updates. This is particularly useful for live feeds, notifications, chat messages, and real-time data updates. Server-Sent ...

Read More

How to add a YouTube Video to your Website?

Fendadis John
Fendadis John
Updated on 16-Mar-2026 931 Views

To add a YouTube video to your website, you need to embed it using the element. The src attribute contains the video URL, while the width and height attributes control the video player dimensions. YouTube provides an embed URL that differs from the regular viewing URL. Instead of using the standard watch URL, you must use YouTube's embed URL format for proper integration into your webpage. Syntax Following is the basic syntax for embedding a YouTube video − Replace VIDEO_ID with the actual YouTube video ID found in the video URL. ...

Read More

How to automatically redirect your visitors to your new home page?

Arjun Thakur
Arjun Thakur
Updated on 16-Mar-2026 2K+ Views

Page redirection is a situation where you click a URL to reach a page X but are internally directed to another page Y. This happens due to page redirection setup by the website developer. HTML provides a simple way to automatically redirect visitors from one page to another using the META tag. To redirect from an HTML page, use the META tag with the http-equiv attribute. The http-equiv attribute provides an HTTP header for the value of the content attribute. The value in the content is the number of seconds you want the page to wait before redirecting. ...

Read More
Showing 701–710 of 1,509 articles
« Prev 1 69 70 71 72 73 151 Next »
Advertisements