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 248 of 840
HTML DOM TransitionEvent propertyName Property
The HTML DOM TransitionEvent propertyName property returns a string that identifies the specific CSS property that triggered a transition event. This property is essential for identifying which CSS property completed its transition when multiple properties are transitioning simultaneously. Syntax Following is the syntax for accessing the CSS property name from a transition event − transitionEvent.propertyName Return Value The propertyName property returns a string representing the name of the CSS property that finished transitioning. For example, it might return "transform", "width", "opacity", or any other CSS property that was being transitioned. Example − ...
Read MoreHow to add images in select list in HTML?
HTML does not natively support images in dropdown lists. However, we can create a custom dropdown using HTML, CSS, and JavaScript that mimics the behavior of a select list while displaying images alongside text options. Why Custom Dropdowns? The standard HTML element only accepts text content in its tags. To include images, we must build a custom solution using divs, buttons, and CSS styling that provides the same user experience as a native select dropdown. Basic Structure A custom image dropdown consists of three main components − Dropdown Button − The ...
Read MoreHTML Navigator appCodeName Property
The HTML navigator appCodeName property returns the browser's code name, which is a string identifier used internally by the browser. This property is part of the Navigator interface and provides information about the user's browser application. Syntax Following is the syntax for accessing the appCodeName property − navigator.appCodeName Return Value The property returns a string representing the code name of the browser. For most modern browsers, this property typically returns "Mozilla" for historical compatibility reasons, regardless of the actual browser being used. Browser Code Names Here are the common values returned ...
Read MoreHTML DOM console.assert() Method
The HTML DOM console.assert() method is used to write an error message to the console only if the first expression (assertion) evaluates to false. This method is particularly useful for debugging and testing conditions during development. If the assertion is true, nothing happens; if it's false, the specified message appears in the browser's developer console. Syntax Following is the syntax for the console.assert() method − console.assert(assertion, message, ...optionalParams); Parameters The console.assert() method accepts the following parameters − assertion − A boolean expression or any value that can be evaluated as truthy ...
Read MoreHTML DOM TransitionEvent Object
The HTML DOM TransitionEvent Object represents events that occur during CSS transitions. It provides information about the transition that has started, is running, or has ended. This object is automatically created when transition-related events are fired on HTML elements with CSS transitions. Syntax TransitionEvent objects are created automatically by the browser. You typically interact with them through event listeners − element.addEventListener("transitionend", function(event) { // event is a TransitionEvent object console.log(event.propertyName); console.log(event.elapsedTime); }); Properties The TransitionEvent object inherits from the Event object and has the ...
Read MoreHTML Navigator appVersion Property
The navigator.appVersion property in HTML returns a string containing version information about the browser. This property provides details about the browser's version, platform, and sometimes additional system information. Syntax Following is the syntax for the navigator appVersion property − navigator.appVersion Return Value The navigator.appVersion property returns a string that typically includes − Version number − The browser version information Platform details − Operating system information Engine information − Browser engine details like WebKit or Gecko Note − The format and content of the ...
Read MoreHTML Navigator cookieEnabled Property
The navigator.cookieEnabled property is a read-only property that returns a boolean value indicating whether HTTP cookies are enabled in the user's browser. This property returns true if cookies are enabled and false if they are disabled. This property is useful for web developers to check cookie support before attempting to set or read cookies, ensuring better user experience and preventing errors in cookie-dependent functionality. Syntax Following is the syntax for the navigator cookieEnabled property − navigator.cookieEnabled Return Value The property returns a boolean value − true − If cookies are ...
Read MoreHow to append to innerHTML without destroying descendants' event listeners with JavaScript?
The innerHTML property in JavaScript allows you to modify the HTML content of an element. However, a common problem occurs when appending content using innerHTML += − it destroys existing event listeners attached to descendant elements. This happens because the entire content is re-parsed and recreated. The Problem with innerHTML += When you use innerHTML += "new content", JavaScript actually performs these steps − Reads the current HTML content Concatenates the new content Replaces the entire innerHTML with the new string Destroys existing DOM elements and their event listeners ...
Read MoreHTML Navigator geolocation Property
The navigator.geolocation property in HTML provides access to the Geolocation API, which allows web applications to retrieve the user's current location. This property returns a Geolocation object that contains methods to get the user's position coordinates, track location changes, and handle location-related errors. The geolocation functionality requires user permission and works best with HTTPS connections. Modern browsers will prompt users to allow or deny location access when a website requests it. Syntax Following is the syntax for accessing the navigator geolocation property − navigator.geolocation The geolocation object provides three main methods − ...
Read MoreHTML DOM Event type Property
The HTML DOM Event type property returns a string corresponding to the event's type such as click, keypress, load, or touchend. This property is useful for identifying which specific event was triggered when using the same event handler function for multiple event types. Syntax Following is the syntax for accessing the Event type property − event.type Return Value The event.type property returns a string representing the type of event that was fired. Common event types include: "click" − Mouse click event "keydown" − Key press event "load" − Page load event ...
Read More