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
Front End Technology Articles
Page 17 of 652
HTML Screen height Property
The screen.height property in JavaScript returns the total height of the user's screen in pixels. This property is part of the Screen interface and provides information about the physical dimensions of the user's display device, including any system toolbars or taskbars. Syntax Following is the syntax for the screen height property − screen.height Return Value The screen.height property returns an integer value representing the total height of the screen in pixels. This includes the entire screen area, not just the browser window. Example Following example demonstrates how to get and display ...
Read MoreHTML Screen colorDepth Property
The HTML Screen colorDepth property returns the bit depth of the color palette for displaying images in bits per pixel. This property indicates how many bits are used to represent the color of each pixel on the screen, which determines the maximum number of colors that can be displayed simultaneously. The colorDepth property is part of the Screen object and provides information about the display capabilities of the user's monitor. Common values include 8, 16, 24, and 32 bits per pixel. Syntax Following is the syntax for the colorDepth property − screen.colorDepth Return ...
Read MoreHTML Screen pixelDepth Property
The HTML Screen pixelDepth property returns the color resolution (bit depth) of the visitor's screen in bits per pixel. This property indicates how many bits are used to represent the color of each pixel, which determines the total number of colors the screen can display. The pixel depth directly affects color quality − higher values mean more colors can be displayed. Common values include 8 bits (256 colors), 16 bits (65, 536 colors), 24 bits (16.7 million colors), and 32 bits (16.7 million colors with transparency). Syntax Following is the syntax for accessing the pixelDepth property − ...
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 onblur Event Attribute
The onblur event attribute in HTML is triggered when an element loses focus. This commonly occurs when a user clicks away from an input field, button, or other focusable element, or when they press the Tab key to navigate to another element. Syntax Following is the syntax for the onblur event attribute − Content The script parameter contains JavaScript code that executes when the element loses focus. Common Use Cases The onblur event is commonly used in the following scenarios − Form validation − Validate input fields when users move ...
Read MoreHTML onclick Event Attribute
The onclick event attribute in HTML is triggered when a user clicks on an HTML element. It allows you to execute JavaScript code in response to mouse clicks, making web pages interactive and dynamic. Syntax Following is the syntax for the onclick event attribute − Content Where script can be either a JavaScript function call or inline JavaScript code that executes when the element is clicked. Basic Example Following example demonstrates a simple onclick event that displays an alert message − Basic onclick Example ...
Read MoreHTML onchange Event Attribute
The onchange event attribute in HTML is triggered when the value of a form element changes and loses focus. This event is commonly used with form controls like input fields, select dropdowns, and textareas to execute JavaScript code when the user modifies the element's value. Syntax Following is the syntax for the onchange event attribute − Where script is the JavaScript code to execute when the change event occurs. Supported Elements The onchange event attribute is supported on the following HTML elements − elements (text, password, email, number, ...
Read MoreHTML 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 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 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 More