Govinda Sai

Govinda Sai

45 Articles Published

Articles by Govinda Sai

45 articles

Execute a script when a reset button in a form is clicked in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 283 Views

The onreset attribute in HTML is an event handler that executes a JavaScript function when a form's reset button is clicked. This attribute is applied to the element and triggers before the form fields are actually reset to their default values. Syntax Following is the syntax for using the onreset attribute − The onreset attribute calls the specified JavaScript function when the user clicks the reset button or programmatically resets the form. Basic Example Following example demonstrates how to execute a ...

Read More

Execute a script when the element loses focus in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 340 Views

The onblur attribute in HTML is used to execute a JavaScript function when an element loses focus. This event is triggered when a user clicks outside the element, tabs to another element, or navigates away from the current input field. Syntax Following is the syntax for the onblur attribute − The function() can be a JavaScript function name or inline JavaScript code that executes when the element loses focus. Text Input with onblur The most common use case is with form input fields where you want to validate or format data ...

Read More

Websockets Apache Server compatibility in HTML5

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 296 Views

WebSocket technology enables real-time, bidirectional communication between web browsers and servers. While Apache HTTP Server is widely used for web applications, it presents specific challenges when implementing WebSocket connections due to its traditional request-response architecture. Apache Server was originally designed for stateless HTTP requests, where each request is processed independently and connections are short-lived. WebSockets, however, require persistent connections that remain open for extended periods to enable real-time data exchange. Apache WebSocket Implementation Options Several approaches exist for implementing WebSockets with Apache Server − Using mod_websocket Module The mod_websocket module extends Apache to handle WebSocket ...

Read More

How to add an inline layer in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 446 Views

The tag was a non-standard HTML element introduced by Netscape Navigator to create inline layers that occupy space within the normal text flow. Unlike the tag which positioned content above the text flow, created layers that pushed subsequent content after the space they occupied. Important: The tag is obsolete and deprecated. It was never part of the HTML standard and was only supported by Netscape Navigator 4.x. Modern browsers do not support this tag, and it should not be used in contemporary web development. Syntax The basic syntax for the tag was ...

Read More

How to create SVG graphics using JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 713 Views

SVG (Scalable Vector Graphics) can be dynamically created and manipulated using JavaScript. This allows you to generate interactive graphics, charts, and animations programmatically. Creating SVG Elements with JavaScript To create SVG elements in JavaScript, use document.createElementNS() with the SVG namespace. Here's how to create a basic SVG container and add shapes: SVG with JavaScript // SVG namespace ...

Read More

How to set line breaking rules for non-CJK scripts in JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 335 Views

The word-break CSS property controls how words break when text overflows its container. For non-CJK (Chinese, Japanese, Korean) scripts like English, you can set different line breaking behaviors using JavaScript. Syntax element.style.wordBreak = "value"; word-break Property Values Value Description Use Case normal Default breaking rules Standard text flow break-all Break anywhere, even mid-word Prevent overflow in narrow containers keep-all Don't break CJK text Preserve CJK word integrity Example: Interactive Word Breaking ...

Read More

How to display rupee symbol in HTML

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 2K+ Views

The Indian rupee symbol (₹) can be displayed in HTML using several methods. Here are the most reliable approaches to ensure proper display across different browsers. Using HTML Entity Code The most straightforward method is using the HTML entity code for the rupee symbol: Rupee Symbol Example Price: ₹500 Amount: ₹1000 Price: ₹500 Amount: ₹1000 Using Font Awesome Icons Font Awesome provides a reliable cross-browser solution with the rupee icon: ...

Read More

Backward compatibility with HTML5

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 1K+ Views

HTML5 is designed to be backward compatible with existing web browsers. New features build on existing features and allow you to provide fallback content for older browsers. Modern browsers like Safari, Chrome, Firefox, and Opera support many HTML5 features. Even older versions of Internet Explorer have partial support, while mobile browsers on iPhones, iPads, and Android phones provide excellent HTML5 compatibility. Feature Detection with JavaScript Instead of browser detection, use feature detection to check if specific HTML5 features are supported: // Check for Canvas support if (document.createElement('canvas').getContext) { console.log('Canvas is ...

Read More

What is the usage of onfocus event in JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 644 Views

The onfocus event is triggered when an HTML element receives focus, typically when a user clicks on an input field or navigates to it using the Tab key. This event is commonly used to provide visual feedback or perform actions when users interact with form elements. Syntax // HTML attribute // JavaScript event listener element.onfocus = function() { /* code */ }; element.addEventListener('focus', function() { /* code */ }); Example: Basic onfocus Implementation Click on the input field to see the onfocus effect: ...

Read More

HTML5 using src using raw binary data

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 1K+ Views

HTML5 allows you to embed binary data directly into src attributes using Data URLs. This is particularly useful when working with files stored in databases or when you need to display content without making separate HTTP requests. Data URL Syntax Data URLs follow this format: data:[mediatype][;base64], data Where: mediatype: MIME type (image/png, audio/mp3, etc.) base64: Optional encoding specification data: The actual binary data (base64 encoded if specified) Using Binary Data with Images For images, you can embed binary data directly in ...

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