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
Articles by Yaswanth Varma
Page 15 of 31
How to redirect from an HTML page?
Page redirection is a situation where you click a URL to reach page X, but internally you are directed to another page Y. This happens due to page redirection mechanisms. Website developers use redirection when they need to move content to a new location, restructure their site, or temporarily redirect users during maintenance. To redirect from an HTML page, we use the META tag with the http-equiv="refresh" attribute. This provides an HTTP header that tells the browser to automatically redirect after a specified time delay. Syntax Following is the syntax for HTML page redirection − ...
Read MoreHow to add a regular expression that an input element's value is checked against in HTML?
The pattern attribute in HTML allows you to specify a regular expression that validates an input element's value before form submission. This attribute provides client-side validation by checking if the entered value matches the specified pattern. The pattern attribute works with input types including text, password, email, search, url, and tel. When a user submits a form, the browser automatically validates the input against the pattern and displays an error message if the value doesn't match. Syntax Following is the syntax for the HTML pattern attribute − Where regular_expression is a ...
Read MoreHow do we set an image to be shown while the video is downloading in HTML?
In this article we are going to learn about how to set an image to be shown while the video is downloading in HTML using the poster attribute. The HTML poster attribute allows developers to display a custom image before the video starts playing. This image is shown while the video is downloading or until the user clicks the play button. If the poster attribute is not specified, the browser displays the first frame of the video as the default thumbnail. Syntax Following is the syntax for the HTML poster attribute − ...
Read MoreHow to specify that the element is read-only in HTML?
In HTML, the readonly attribute specifies that an input field or textarea element cannot be edited by the user. The element displays its value but does not accept user input, making it useful for displaying data that should not be modified while still allowing the value to be submitted with forms. The readonly attribute is commonly used for form fields that contain calculated values, reference data, or information that should be visible but not editable. Unlike the disabled attribute, readonly elements can still receive focus and their values are included in form submissions. Syntax Following is the ...
Read MoreHow do we set the visible number of lines in a text area in HTML?
This article will teach you how to set the visible number of lines in a textarea in HTML. The HTML element is useful for multi-line editing control and allows the user to enter a sizeable amount of free-form text. The rows attribute determines how many lines of text are visible without scrolling. Syntax Following is the syntax to set the visible number of lines in textarea − Content The rows attribute specifies the number of visible text lines for the control. It determines the textarea's visible height in terms of character lines. The ...
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 do we add the width in characters for in HTML?
The size attribute in HTML input elements specifies the visible width of an input field in terms of characters. This attribute controls how wide the input field appears on the screen, making it useful for creating forms with appropriately sized input fields based on expected content length. The size attribute works with text-based input types including text, search, tel, url, email, and password. While it affects the display width, it does not limit the actual number of characters a user can enter − that requires the maxlength attribute. Syntax Following is the syntax for the size attribute ...
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 More