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 16 of 31
Set the number of columns to span in HTML
The colspan attribute in HTML allows you to set the number of columns that a table cell should span. This enables a single or element to stretch across multiple columns, similar to the "merge cells" feature in spreadsheet applications like Excel. The colspan attribute is essential for creating complex table layouts where certain cells need to occupy more horizontal space than others, such as headers that span across multiple data columns or summary rows that extend across the entire table width. Syntax Following is the syntax for the colspan attribute − Content Content ...
Read MoreHow to set the URL of the media file in HTML?
In this article, we are going to learn about how to set the URL of the media file in HTML using the element. This element allows you to specify multiple media sources with different formats, enabling browsers to choose the most suitable format they support. The element is used inside , , and elements to provide alternative media resources. By offering multiple formats, you ensure better cross-browser compatibility and optimal media delivery across different devices and platforms. Syntax Following is the syntax for the element − The src ...
Read MoreExecute a script when the user pastes some content in an element in HTML?
In this article, we are going to execute a script when the user pastes content into an element in HTML. The onpaste event is triggered when a user pastes content into an element, making it useful for validation, formatting, or tracking paste operations. Although all HTML elements accept the onpaste event, you cannot actually paste content into elements like or unless they have the contenteditable attribute set to "true". Most commonly, the onpaste event is used with elements of type="text" and elements. Syntax Following is the syntax for using the onpaste event in ...
Read MoreExecute a script before the document is printed in HTML?
The onbeforeprint attribute in HTML is an event handler that executes a JavaScript function before a document is printed. This attribute triggers when the user attempts to print the page through browser print functionality (Ctrl+P, File → Print, or print button), displaying custom messages or performing actions before the print dialog appears. The onbeforeprint event is commonly used together with the onafterprint attribute to handle print preparation and cleanup tasks. It belongs to the HTML event attributes category and can be applied to the element or used with JavaScript event listeners. Syntax Following is the syntax ...
Read MoreExecute a script when there have been changes to the anchor part of the URL in HTML?
The onhashchange event in HTML executes a script whenever the anchor part (hash fragment) of the URL changes. The anchor part refers to the portion of the URL that comes after the # symbol, commonly used for navigation within a page or single-page applications. This event is particularly useful for detecting when users navigate using the browser's back/forward buttons or when the URL hash is programmatically modified. The hash change can be detected using either the onhashchange attribute or JavaScript event listeners. Syntax Following is the syntax for the onhashchange attribute − ...
Read MoreHow do we set the type of element in HTML?
In HTML, the type attribute is used to specify the type or behavior of various HTML elements. This attribute is essential for defining how elements should function and what kind of content they handle. The type attribute is commonly used with form elements like and , as well as multimedia and resource elements. The type attribute serves different purposes depending on the element − Form elements − Defines the input type or button behavior Script elements − Specifies the scripting language or MIME type Media elements − Indicates the media format or MIME type Link elements ...
Read MoreHow to add the value of the element in HTML?
The value attribute in HTML specifies the initial or default value for various form elements. It serves different purposes depending on the element type − from setting default text in input fields to defining the data sent when buttons are clicked. Understanding how to properly use the value attribute is essential for creating functional HTML forms. Syntax Following is the basic syntax for using the value attribute − The value attribute can be used with the following HTML elements − − Sets default value for form inputs − Defines ...
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 MoreHow do we display a text area in HTML?
The textarea element in HTML is used to create a multi-line text input control that allows users to enter larger amounts of text. Unlike regular input fields, textareas can display multiple lines of text and are commonly used for comments, descriptions, messages, and other extended text content in forms. The textarea displays text in a fixed-width font (typically Courier) and can hold an unlimited number of characters. It is essential for collecting user feedback, reviews, addresses, and any content that requires more than a single line of text. Syntax Following is the basic syntax for creating a ...
Read MoreHow to create table footer in HTML?
The task we are going to perform in this article is how to create table footer in HTML. As we are familiar with table in HTML, let's have a quick look on it. A table in HTML makes a lot of sense when you want to organize data that would look best in a spreadsheet. A table is a visual representation of rows and columns of data. You may organize data like photos, text, links, and more into rows and columns of cells in HTML by using tables. Syntax Following is the syntax for creating a table ...
Read More