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 on Trending Technologies
Technical articles with clear explanations and examples
How to give a limit to the input field in HTML?
The HTML tag is used to collect user input in web forms. To give a limit to the input field, use the min and max attributes, which specify the minimum and maximum values for an input field respectively. The min and max attributes work with number, range, date, datetime-local, month, time, and week input types. These attributes help validate user input on the client side and provide better user experience by preventing invalid entries. Syntax Following is the syntax for setting input limits using the min and max attributes − For ...
Read MoreExecute a script when a mouse button is released over an element in HTML?
When a mouse button is released over an HTML element, the onmouseup event is triggered. This event is commonly used for creating interactive elements that respond to mouse clicks and releases. The onmouseup attribute can be added to any HTML element to execute JavaScript code when the user releases a mouse button while the cursor is over that element. Syntax Following is the syntax for the onmouseup event attribute − Content Where script is the JavaScript code that executes when the mouse button is released over the element. How It Works The ...
Read MoreHTML DOM Input Datetime type Property
The HTML DOM Input Datetime type property allows you to get or set the type attribute of an input element that was initially created as a datetime input. This property is useful for dynamically changing input types or checking the current type of an input element. Note: The datetime input type has been deprecated in HTML5. Most modern browsers treat it as a text input. For date and time inputs, use datetime-local, date, or time instead. Syntax Following is the syntax for returning the type value − inputDatetimeObject.type Following is the syntax for ...
Read MoreHow to limit the number of characters allowed in form input text field?
In this article, we will learn how to limit the number of characters allowed in form input text field using HTML attributes. HTML provides built-in attributes to control the character limits in input fields. The maxlength attribute sets the maximum number of characters allowed, while the minlength attribute sets the minimum number of characters required for validation. Syntax Following is the syntax for the maxlength attribute − Following is the syntax for the minlength attribute − Both attributes can be used together to set a character range ...
Read MoreExecute a script when the seeking attribute is set to false indicating that seeking has ended in HTML?
The onseeked attribute in HTML executes a script when the user finishes seeking (jumping to a new position) in an audio or video element. This event fires when the seeking attribute changes from true to false, indicating that the seek operation has completed and the media is ready to play from the new position. Syntax Following is the syntax for the onseeked attribute − Where script is the JavaScript code to execute when seeking ends. How It Works When a user interacts with the video or audio controls to jump ...
Read MoreHTML DOM Input Datetime value Property
The HTML DOM Input Datetime value property allows you to get or set the value of a datetime input field. This property returns the current value as a string in ISO 8601 format or sets a new datetime value programmatically. Syntax Following is the syntax for getting the datetime value − inputDatetimeObject.value Following is the syntax for setting the datetime value − inputDatetimeObject.value = "YYYY-MM-DDTHH:MM:SSZ" The datetime value must be in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ where T separates date and time, and Z indicates UTC timezone. Return Value ...
Read MoreHow to limit an HTML input box so that it only accepts numeric input?
In this article, we will learn how to limit an HTML input box so that it only accepts numeric inputs. The most effective way to restrict input to numbers is using . This creates a numeric input field that automatically validates user input and provides built-in controls like spinner buttons. Additionally, we can use attributes like min, max, and step to further control the allowed numeric values. Syntax Following is the basic syntax to create a numeric input field − Following is the syntax with additional attributes for range control − ...
Read MoreHow do we define the start of a term in a definition list in HTML?
The HTML tag is used to define the start of a term in a definition list. A definition list is similar to other lists but in a definition list, each list item contains two entries: a term and a description. The tag defines the term, while the tag provides its corresponding definition or description. Syntax Following is the syntax for the tag − Term Description of the term The element must be used within a (definition list) container and is ...
Read MoreHow to allow multiple file uploads in HTML forms.
In this article, we will learn how to allow multiple file uploads in HTML forms. The multiple attribute enables users to select and upload several files at once through a single input field, providing a more efficient user experience for file uploads. The multiple attribute is a boolean attribute that works with email and file input types. When applied to file inputs, it allows users to select multiple files from their device using the standard file picker dialog. Syntax Following is the syntax for enabling multiple file uploads in HTML forms − ...
Read MoreHow do we create a footer for a document or section in HTML5?
The HTML5 element represents a footer for a document or section. It typically contains authorship information, copyright notices, links to related documents, or other metadata. The footer provides semantic meaning to the content and helps screen readers and search engines understand the document structure. Syntax Following is the syntax for the HTML5 footer element − Footer content here The element can be used multiple times in a document. It can appear as a footer for the entire page or as a footer for individual sections like articles ...
Read More