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 242 of 840
HTML DOM Button value Property
The HTML DOM Button value property is associated with the value attribute of the element. It specifies the hidden value of the button that is sent to the server when the button is clicked in a form submission. The value property allows you to set or retrieve the value attribute of a button element programmatically using JavaScript. The button's value is different from its display text. The display text is what appears between the opening and closing tags, while the value is the data sent to the server during form submission. Syntax Following is the ...
Read MoreHow to Detect User Timezone in JavaScript?
Detecting the user's timezone in JavaScript is essential for creating applications that display accurate local time information. JavaScript provides multiple methods to determine the user's timezone, from getting the timezone name to calculating the offset from UTC. Syntax Following is the syntax for detecting timezone using the Internationalization API − Intl.DateTimeFormat().resolvedOptions().timeZone Following is the syntax for getting timezone offset using the Date object − new Date().getTimezoneOffset() Using Intl.DateTimeFormat() for Timezone Name The Internationalization API provides the most reliable way to detect the user's timezone with its actual name. The ...
Read MoreHTML DOM TouchEvent altKey Property
The HTML DOM TouchEvent altKey property returns a Boolean value indicating whether the Alt key was pressed when a touch event was fired. This property is useful for creating touch interfaces that respond differently based on modifier key combinations. Syntax Following is the syntax for the TouchEvent altKey property − touchEvent.altKey Return Value The property returns a Boolean value indicating the state of the Alt key − Return Value Description true The Alt key was pressed when the touch event occurred false The ...
Read MoreHTML DOM TouchEvent ctrlKey Property
The HTML DOM TouchEvent ctrlKey property returns a boolean value that indicates whether the Ctrl key was pressed when a touch event was triggered. This property is useful for creating touch interfaces that respond differently based on modifier key combinations. Syntax Following is the syntax for accessing the ctrlKey property − touchEvent.ctrlKey Return Value The property returns a boolean value indicating the state of the Ctrl key − Return Value Description true The Ctrl key was pressed when the touch event occurred false ...
Read MoreHTML DOM Input Password placeholder property
The HTML DOM Input Password placeholder property is used for setting or returning the placeholder attribute value of a password input field. The placeholder provides a hint to users about what kind of input is expected, displaying greyed-out text inside the field before any user input. Unlike the value property, placeholder text is not submitted with the form data. Syntax Following is the syntax for setting the placeholder property − passwordObject.placeholder = text Following is the syntax for getting the placeholder property − var placeholderText = passwordObject.placeholder Parameters text ...
Read MoreHTML DOM TouchEvent Object
The HTML DOM TouchEvent Object represents events that occur when users interact with HTML document elements using touch-enabled devices like smartphones, tablets, or touch screens. Touch events are essential for creating responsive mobile web applications. TouchEvent Properties The TouchEvent object provides several properties to detect modifier key states and touch point information − Property Description altKey Returns a Boolean value indicating if the Alt key was pressed when the touch event was fired. changedTouches Returns a TouchList object containing all contact points that triggered a state change in ...
Read MoreHow do I keep two side-by-side div elements the same height?
We need to keep two side-by-side div elements the same height so that when more content is added to either div, both divs automatically match in height. This creates a consistent, professional layout that prevents uneven column appearances. There are several approaches to achieve equal height columns. We will explore the most effective methods − CSS Table Display − Using display: table-cell for automatic height matching CSS Flexbox − Modern approach with display: flex CSS Grid − Grid layout for equal height columns JavaScript − Programmatically setting heights to match Equal Height ...
Read MoreHow do you keep parents of floated elements from collapsing in CSS?
When elements are floated using CSS, their parent container loses awareness of their dimensions, causing the parent to collapse and appear as if it has no content. This happens because floated elements are removed from the normal document flow, making the parent container unable to calculate its height based on the floated children. This article demonstrates the problem and provides several effective solutions to prevent parent collapse when containing floated elements. Understanding Parent Collapse Before applying fixes, let's first observe how parent collapse occurs with floated elements. Example − Normal Flow Without Floats Here's how ...
Read MoreHow to disable Google Chrome autofill option?
Google Chrome's autofill feature can sometimes interfere with user experience by automatically populating form fields with previously entered data. To disable this functionality, you can use the autocomplete attribute with specific values that prevent Chrome from filling in form data. Syntax Following is the syntax to disable autofill on form elements − The autocomplete attribute can be applied to both the element and individual elements to control autofill behavior. Using autocomplete="off" The standard approach is to set autocomplete="off" on the form or individual input fields. However, Chrome may ...
Read MoreHTML DOM Track default Property
The HTML DOM Track default property sets or returns a boolean value that determines whether a text track should be enabled by default when the media element loads, unless the user's preferences override this setting. Note: Only one track element should have the default attribute set to true per media (audio/video) element to avoid conflicts. Syntax Following is the syntax for returning the default property value − trackObject.default Following is the syntax for setting the default property − trackObject.default = booleanValue Parameters The booleanValue parameter can have the ...
Read More