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 254 of 840
HTML oncopy Event Attribute
The HTML oncopy attribute is an event handler that triggers when a user copies the content of an HTML element. This attribute can be applied to any HTML element to execute JavaScript code whenever the copy action occurs, whether through keyboard shortcuts (Ctrl+C), right-click context menu, or browser menu options. Syntax Following is the syntax for the oncopy attribute − Content Where script is the JavaScript code to execute when the copy event is triggered. Parameters The oncopy attribute accepts a single parameter − script − JavaScript code or function ...
Read MoreHTML5 Semantics
HTML5 Semantics refers to semantic elements that provide meaningful structure and context to web content. Unlike generic and elements, semantic tags clearly describe their purpose and content to browsers, search engines, and assistive technologies. Semantic elements improve accessibility, SEO optimization, and code maintainability by making HTML documents more structured and meaningful. They help screen readers navigate content better and allow search engines to understand page structure more effectively. Benefits of HTML5 Semantic Elements Better SEO − Search engines can better understand and index your content structure. Improved Accessibility − Screen readers can navigate and ...
Read MoreHTML DOM Video defaultMuted Property
The HTML DOM Video defaultMuted property sets or returns a boolean value that indicates whether the video's audio should be muted by default when the page loads. This property reflects the state of the HTML muted attribute and determines the initial mute state of the video element. Note − This property only affects the default state when the video loads. It does not dynamically mute or unmute the video during playback. To control muting during playback, use the muted property instead. Syntax Following is the syntax for getting the defaultMuted property − videoObject.defaultMuted ...
Read MoreHTML DOM Input Range stepUp() method
The HTML DOM Input Range stepUp() method is used for incrementing the slider control value by a specified number. If no parameter is provided, it will increment by 1. If the step attribute is specified on the range input, the stepUp() method will increment in multiples of that step value. For example, if step="20" then stepUp(2) will increment by 20 × 2 = 40. Syntax Following is the syntax for the Range stepUp() method − rangeObject.stepUp(number) Parameters number − An optional parameter that specifies the increment value for the slider control. If omitted, ...
Read MoreHTML oncut Event Attribute
The HTML oncut event attribute is triggered when a user cuts content from an HTML element. This event fires when the cut operation is performed using Ctrl+X keyboard shortcut, right-click context menu, or any other method that removes selected content to the clipboard. Syntax Following is the syntax for the oncut event attribute − Content Where script is the JavaScript code to execute when the cut event occurs. Parameters The oncut event attribute accepts the following parameter − script − Specifies the JavaScript code or function to run when the ...
Read MoreHTML vs XML
HTML and XML are both markup languages that use tags to structure information, but they serve fundamentally different purposes. HTML (HyperText Markup Language) is designed for creating and displaying web pages with predefined elements, while XML (eXtensible Markup Language) is a flexible data format used primarily for storing and transporting structured data. HTML (HyperText Markup Language) HTML stands for HyperText Markup Language, which is used to describe the structure and presentation of web pages. It consists of various HTML elements composed of opening tags, content, and closing tags. HTML creates hypertext documents that can link to other pages ...
Read MoreHTML oncontextmenu Event Attribute
The oncontextmenu event attribute in HTML is triggered when a user right-clicks on an element to open the context menu. This event allows developers to customize behavior when the context menu appears, such as displaying custom menus or preventing the default context menu from showing. Syntax Following is the syntax for the oncontextmenu event attribute − Content The script can be a JavaScript function call or inline JavaScript code that executes when the user right-clicks on the element. Parameters The oncontextmenu event handler receives an event object as a parameter with the ...
Read MoreHTML DOM Video duration Property
The HTML DOM Video duration property returns the duration of a video in seconds as a numeric value. This read-only property is essential for creating custom video controls, progress bars, and displaying video information to users. Note − For live streams, the duration property returns Infinity because live content has no predefined end time. Syntax Following is the syntax for accessing the duration property − videoObject.duration Return Value The duration property returns a numeric value representing − The length of the video in seconds (for recorded videos) Infinity for live ...
Read MoreHTML DOM Location search Property
The Location search property returns or sets the query string portion of a URL, including the leading question mark (?). This property allows you to read the search parameters from the current URL or programmatically modify them. Syntax Following is the syntax for getting the search property − location.search Following is the syntax for setting the search property − location.search = searchString Parameters searchString − A string representing the query parameters, including the leading question mark. For example: "?name=john&age=25" Return Value Returns a string containing the query ...
Read MoreHTML DOM Input Range type property
The HTML DOM Input Range type property is associated with input elements having type="range". This property returns the string "range" for range input elements, confirming their input type programmatically. The range input type creates a slider control that allows users to select a numeric value within a specified range. The type property helps identify and validate that an input element is indeed a range slider. Syntax Following is the syntax for accessing the type property of a range input element − rangeObject.type Return Value The type property returns a string value "range" ...
Read More