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
HTML Articles
Page 19 of 151
HTML DOM Textarea placeholder Property
The HTML DOM Textarea placeholder property is used to get or set the value of the placeholder attribute of a textarea element. The placeholder provides a hint to users about what kind of information is expected in the textarea field. Syntax Following is the syntax for returning the placeholder value − textareaObject.placeholder Following is the syntax for setting the placeholder value − textareaObject.placeholder = "text" Property Value The placeholder property accepts a string value that specifies the short hint displayed in the textarea before the user enters a value. ...
Read MoreHTML DOM Textarea wrap Property
The HTML DOM Textarea wrap property gets and sets the value of the wrap attribute of a textarea element. This property controls how text wrapping behaves when the form is submitted to the server. Syntax Following is the syntax for getting the wrap property − object.wrap Following is the syntax for setting the wrap property − object.wrap = "soft" | "hard" Property Values The wrap property accepts the following values − soft − The text is wrapped visually but line breaks are not inserted when the ...
Read MoreHTML option value Attribute
The HTML option value attribute defines the value that will be sent to the server when a form is submitted. The value attribute specifies what data is transmitted for each option in a select dropdown, which may differ from the visible text displayed to users. Syntax Following is the syntax for the option value attribute − Display Text Where text is the value sent to the server, and Display Text is what users see in the dropdown. How It Works When a user selects an option and submits the form, the browser ...
Read MoreHTML 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 More