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 AmitDiwan
Page 245 of 840
How to Close Browser Tabs With a Keyboard Shortcut?
Keyboard shortcuts provide a quick and efficient way to close browser tabs without using the mouse. These shortcuts are universal across all major web browsers and can significantly improve your browsing productivity. Universal Keyboard Shortcuts The following keyboard shortcuts work across all major browsers including Chrome, Firefox, Safari, Edge, and Opera − Windows and Linux To close the current active tab − Ctrl+W To close the entire browser window (all tabs) − Ctrl+Shift+W Mac To close the current active tab − Command+W To close the entire browser window (all ...
Read MoreHTML DOM Input Time name Property
The HTML DOM Input Time name property allows you to get or set the value of the name attribute for a time input element. The name attribute is used to identify form data when it's submitted to the server and can also be referenced in JavaScript for client-side manipulation. Syntax Following is the syntax to get the name property − inputTimeObject.name Following is the syntax to set the name property − inputTimeObject.name = "string" Return Value The property returns a string that represents the value of the name attribute ...
Read MoreHTML onscroll Event Attribute
The onscroll event attribute in HTML is triggered when an element's content is scrolled using its scrollbar. This event fires continuously as the user scrolls through the element's content, making it useful for creating dynamic scroll-based interactions and animations. The onscroll event can be applied to any HTML element that has scrollable content, including the entire document body, div containers, textarea elements, and other elements with overflow properties set to scroll or auto. Syntax Following is the syntax for the onscroll event attribute − Content Where script is the JavaScript code or function ...
Read MoreHTML DOM Input Time Object
The HTML DOM Input Time Object represents an HTML element with type="time". This object allows users to select a time value and provides JavaScript access to manipulate time input fields programmatically. Syntax Following is the syntax to create an input element with type time − var timeObject = document.createElement("input"); timeObject.type = "time"; To access an existing time input element − var timeObject = document.getElementById("timeId"); Properties The Input Time object supports the following properties − Property Description autocomplete Sets or returns ...
Read MoreHTML onsearch Event Attribute
The HTML onsearch event attribute is triggered when a user presses the "Enter" key or clicks the search button (×) in an HTML input element with type="search". This event is specifically designed for search input fields and provides a way to execute JavaScript when a search action is performed. Syntax Following is the syntax for the onsearch event attribute − Where script is the JavaScript code or function to execute when the search event occurs. Parameters The onsearch event attribute accepts the following parameter − script − JavaScript code ...
Read MoreHTML DOM Input Time readOnly Property
The HTML DOM Input Time readOnly property sets or returns whether an Input Time field can be modified by the user. When set to true, the input becomes read-only and displays a grayed-out appearance, preventing user interaction while still allowing programmatic access. Syntax Following is the syntax for getting the readOnly property value − inputTimeObject.readOnly Following is the syntax for setting the readOnly property − inputTimeObject.readOnly = booleanValue Return Value The readOnly property returns a Boolean value − true − If the time input field is read-only ...
Read MoreHTML DOM Clipboard event
The HTML DOM Clipboard event is triggered when the user performs clipboard operations such as cut, copy, or paste on web page content. These events provide information about clipboard modifications and allow developers to create more interactive and accessible web applications by responding to user clipboard actions. Syntax Following is the syntax for creating a Clipboard event − var clipboardEvent = new ClipboardEvent(type, [options]); Where type can be 'cut', 'copy', or 'paste', and the optional options parameter contains properties like clipboardData, dataType, and data. Properties Following is the main property for Clipboard ...
Read MoreHTML onselect Event Attribute
The HTML onselect event attribute is triggered when a user selects text within certain HTML elements. This event works primarily with form elements that contain editable text, such as and elements. Syntax Following is the syntax for the onselect event attribute − Content Where script is the JavaScript code to execute when text selection occurs. Supported Elements The onselect event attribute works with the following HTML elements − − Single-line text input fields − Password input fields − Search input fields − Multi-line text ...
Read MoreDoes ID have to be unique in the whole HTML page?
Yes, ID attributes must be unique throughout the entire HTML document. According to the official HTML specification, each ID value can appear only once per page. This uniqueness requirement ensures proper functionality for CSS styling, JavaScript manipulation, and anchor linking. Why ID Uniqueness Matters The uniqueness of IDs is critical for several reasons − CSS Targeting − The # selector in CSS expects to target exactly one element. Multiple elements with the same ID can cause styling conflicts. JavaScript Selection − Methods like getElementById() return only the first matching element, ignoring duplicates. Anchor Navigation − Browser ...
Read MoreHTML DOM Input Time required Property
The HTML DOM Input Time required property controls whether a time input field must be filled out before the form can be submitted. This property returns or sets a boolean value indicating if the time field is mandatory. Syntax Following is the syntax for returning the required property − inputTimeObject.required Following is the syntax for setting the required property − inputTimeObject.required = booleanValue Parameters The booleanValue parameter accepts the following values − Value Description true The time field is required and ...
Read More