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
Web Development Articles
Page 70 of 801
How to use year input type in HTML?
HTML does not have a dedicated year input type. However, you can create year input functionality using several approaches: the element with constraints, the element, or by implementing custom year picker solutions with JavaScript libraries like jQuery UI. Using Number Input Type for Year The most common approach is to use with min and max attributes to constrain the year range. The placeholder attribute helps users understand the expected format. Syntax Example Following example creates a year input field using a number input type − ...
Read MoreHow to store data in the browser with the HTML5 localStorage API?
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 MoreHow to use sockets in JavaScriptHTML?
To enable bidirectional communication between web applications and server-side processes, JavaScript provides the WebSocket API. Unlike traditional HTTP requests, WebSockets maintain a persistent connection allowing real-time data exchange in both directions. WebSockets are commonly used for chat applications, live notifications, real-time gaming, stock price updates, and collaborative editing tools where instant communication is essential. Syntax Following is the syntax to create a WebSocket connection − const socket = new WebSocket(url [, protocols]); Where url is the WebSocket server URL (starting with ws:// or wss://) and protocols is an optional string or array of ...
Read MoreCreate a shortcut key to activate an element in HTML
The accesskey attribute in HTML allows you to create keyboard shortcuts for activating elements like links, buttons, and form controls. This global attribute enhances web accessibility and provides quick navigation options for users. The accesskey attribute accepts a single character value that, when combined with browser-specific modifier keys, activates the associated element. This feature is particularly useful for improving website usability and accessibility. Syntax Following is the syntax for the accesskey attribute − Content The character value must be a single printable character that can be typed on a keyboard, including letters, numbers, ...
Read MoreHow to add an address element in HTML?
The address element in HTML represents contact information for a person, organization, or article. It provides semantic meaning to contact details and helps search engines and assistive technologies understand the purpose of the content. When used within the element, it represents contact information for the entire document. When placed inside an element, it represents contact information specific to that article. The element accepts all global attributes and is typically displayed in italics by default in most browsers. Syntax Following is the syntax for the address element − Contact ...
Read MoreHow to create the tabbing order of an element in HTML?
The tabindex attribute in HTML controls the sequential keyboard navigation order of elements, typically using the TAB key. It determines which elements can receive focus and in what order users will navigate through them when using keyboard navigation. Syntax Following is the syntax for the tabindex attribute − Content The tabindex value can be − Positive integer (1, 2, 3, ...) − Creates a custom tab order. Elements are focused in ascending numerical order before any elements with tabindex="0". 0 (zero) − Includes the element in the natural tab order based on ...
Read MoreHow to represent text that must be isolated from its surrounding for bidirectional text formatting in HTML?
The (Bidirectional Isolate) HTML element tells the browser's bidirectional algorithm to treat the text it contains independently from its surrounding content. This is essential when embedding text of unknown directionality, such as user-generated content or dynamic text from databases. Languages like Arabic, Hebrew, and Urdu are written from right-to-left (RTL), while English and most other languages are written left-to-right (LTR). When mixing these text directions in a single document, proper isolation prevents text rendering issues and ensures correct display order. Syntax Following is the basic syntax for the element − text content ...
Read MoreInclude information about the document in HTML
Use the tag to include information about the document. The HTML element contains metadata and other information about the document that is not displayed directly in the browser window. This section provides essential information to browsers, search engines, and other web services about your HTML document. Syntax Following is the basic syntax for the element − Common Elements in the Head Section The section typically contains several important elements − − Defines the document title shown in the browser tab ...
Read MoreCreate a command/menu item that the user can invoke from a popup menu in HTML5
The tag in HTML5 was designed to create command/menu items that users can invoke from popup context menus. However, it's important to note that this element has been deprecated and is no longer supported in modern browsers due to lack of widespread adoption and implementation inconsistencies. The tag was intended to work with the element to create interactive context menus that would appear when users right-clicked on elements with a contextmenu attribute. Syntax Following is the syntax for the deprecated tag − Attributes ...
Read MoreHow do we display a table cell in HTML
In HTML, table cells are the individual containers that hold data within a table structure. The element defines a standard data cell, while defines header cells. Understanding how to properly display and format table cells is essential for creating organized, accessible data presentations. Syntax Following is the basic syntax for creating table cells − Header Cell Header Cell Data Cell Data Cell ...
Read More