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 252 of 840
HTML DOM Input Range object
The HTML DOM Input Range object represents an element with type="range". This object provides methods and properties to manipulate range slider controls through JavaScript. We can create a new range input using createElement() or access an existing one using getElementById(). Syntax Creating a new input range element − var rangeElement = document.createElement("INPUT"); rangeElement.setAttribute("type", "range"); Accessing an existing input range element − var rangeElement = document.getElementById("myRange"); HTML syntax for range input − Properties Following are the properties for the Input Range object − ...
Read MoreHTML Window resizeBy() Method
The HTML Window resizeBy() method resizes a window by a specified amount relative to its current dimensions. This method adjusts the window's width and height by adding the provided pixel values to the current size. Syntax Following is the syntax for the Window resizeBy() method − window.resizeBy(width, height) Parameters The resizeBy() method accepts the following parameters − width − An integer representing the number of pixels to resize the window width. Positive values increase the width, negative values decrease it. height − An integer representing the number of pixels to resize ...
Read MoreHTML DOM Video buffered Property
The HTML DOM Video buffered property returns a TimeRanges object that provides information about the buffered portions of the video. This read-only property helps determine which parts of the video have been downloaded and are ready for playback without interruption. The TimeRanges object contains information about buffered time ranges, including the length of buffered ranges and their start and end positions in seconds. Syntax Following is the syntax for accessing the buffered property − videoElement.buffered Return Value The buffered property returns a TimeRanges object with the following methods − length ...
Read MoreHTML File Paths
A file path in HTML specifies the location of a resource (like images, videos, stylesheets, or scripts) within a website. File paths can be either relative (pointing to files in relation to the current document) or absolute (providing the complete URL to a resource). Understanding file paths is crucial for linking resources correctly, ensuring your website works properly across different environments, and maintaining organized project structures. Syntax Following are the different syntaxes for specifying file paths − Relative Path Syntax src="filename.jpg" src="folder/filename.jpg" src="../folder/filename.jpg" src="/folder/filename.jpg" Absolute Path Syntax src="https://www.example.com/images/filename.jpg" ...
Read MoreHTML view Event Property
The HTML view Event property returns a reference to the Window object where the event occurred. This property is available on UI events like mouse clicks, keyboard inputs, and focus events, providing access to the window context in which the event was triggered. Syntax Following is the syntax for accessing the view property − event.view Return Value The view property returns a Window object reference. In most cases, this will be the same as the global window object. If the event occurs in an iframe or popup window, it returns the reference to ...
Read MoreHTML DOM Video canPlayType( ) Method
The HTML DOM Video canPlayType() method returns a string indicating whether the browser can play the specified video type. This method helps determine video format compatibility before attempting playback, allowing developers to provide fallback options or choose the most suitable video format. Syntax Following is the syntax for the canPlayType() method − videoObject.canPlayType(type) Parameters The method accepts one parameter − type − A string specifying the MIME type of the video format to test (e.g., "video/mp4", "video/webm", "video/ogg"). Return Value The canPlayType() method returns one of three possible ...
Read MoreHTML for Attribute
The HTML for attribute establishes a connection between a element and a form control. When the for attribute's value matches the id of another element, clicking the label will focus or activate the associated control, improving accessibility and user experience. Syntax Following is the syntax for the HTML for attribute − Label Text To access the for attribute in JavaScript, use the htmlFor property − labelObject.htmlFor How the For Attribute Works The for attribute creates an explicit association between a label and a form element. This provides ...
Read MoreHTML Viewport meta tag for Responsive Web Design
The viewport meta tag is essential for creating responsive web designs that adapt to different screen sizes and devices. It controls how a web page is displayed in the browser's viewport, ensuring that your content looks good on desktops, tablets, and mobile devices. Without the viewport meta tag, mobile browsers render pages at a default desktop width (usually 980px) and then scale it down, making content appear tiny and requiring users to zoom and scroll horizontally. Syntax Following is the basic syntax for the viewport meta tag − The tag must be ...
Read MoreHTML Window top Property
The HTML Window top property returns a reference to the topmost browser window in the window hierarchy. This property is particularly useful when working with frames or iframes to determine if the current window is the main parent window or nested within another window. Syntax Following is the syntax for the window.top property − window.top Return Value The property returns a Window object reference to the topmost window. If the current window is already the topmost window, it returns a reference to itself. How It Works When a web page contains ...
Read MoreHTML DOM Video controls Property
The HTML DOM Video controls property returns or sets a boolean value that determines whether the video's standard playback controls (play, pause, volume, etc.) are displayed to the user. Syntax Following is the syntax for returning the controls property − mediaObject.controls Following is the syntax for setting the controls property − mediaObject.controls = booleanValue Parameters The booleanValue can be one of the following − Value Description true The video will display standard controls (play, pause, volume, progress bar, etc.) ...
Read More