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 97 of 151
Set the text wrap in a form in HTML
The wrap attribute in HTML controls how text wrapping behaves in a element. This attribute determines whether line breaks are inserted when the text reaches the edge of the textarea and how those line breaks are handled when the form is submitted to the server. Syntax Following is the syntax for the wrap attribute − Text content The value can be soft, hard, or off. Wrap Attribute Values The wrap attribute accepts three possible values − soft − Text wraps visually in the textarea, but line breaks are not ...
Read MoreExecute a script when a mouse button is pressed down on an element in HTML?
The onmousedown attribute in HTML executes a script when a mouse button is pressed down on an element. This event fires before the onmouseup event and is useful for creating interactive elements that respond to mouse press actions. Syntax Following is the syntax for the onmousedown attribute − Content The script parameter contains JavaScript code or function calls to execute when the mouse button is pressed down. Basic Example Following example demonstrates the onmousedown attribute with color changes − onmousedown Example ...
Read MoreDrawing text to HTML5 with @fontface does not work at the first time
Drawing text in an HTML5 canvas with a typeface loaded via @font-face often fails to display correctly on the first render. This occurs because the browser has not yet fully loaded the custom font from the network, causing it to fall back to a default system font instead. The key issue is timing − the canvas attempts to draw text before the custom font has finished downloading and becomes available to the rendering engine. Syntax Following is the basic syntax for defining a custom font with @font-face − @font-face { font-family: 'CustomFont'; ...
Read MoreHTML DOM Input Month autofocus Property
The HTML DOM Input Month autofocus Property controls whether a month input field should automatically receive focus when the page loads. This property returns a boolean value indicating the current autofocus state and allows you to programmatically enable or disable the autofocus behavior. Syntax Following is the syntax to return the autofocus property − object.autofocus Following is the syntax to set the autofocus property − object.autofocus = true | false Parameters The autofocus property accepts the following boolean values − true − The month input field will ...
Read MoreHTML DOM Input Number Object
The HTML DOM Input Number Object represents an element with type="number". This object provides properties and methods to interact with number input fields programmatically through JavaScript. The Input Number Object is useful for creating dynamic forms, validating numeric input, and implementing custom number controls with step increment/decrement functionality. Syntax You can create an Input Number Object in two ways − Creating a new Input Number element: var numberInput = document.createElement("INPUT"); numberInput.setAttribute("type", "number"); Accessing an existing Input Number element: var numberInput = document.getElementById("myNumber"); Properties The Input Number ...
Read MoreHow can I use the HTML5 canvas element in IE?
The HTML5 canvas element provides a powerful way to create dynamic graphics and animations directly in the browser. However, older versions of Internet Explorer (IE6-IE8) do not natively support the canvas element. To enable canvas functionality in these browsers, you can use the excanvas JavaScript library. What is ExplorerCanvas? ExplorerCanvas (also known as excanvas) is a JavaScript library that emulates HTML5 canvas functionality in Internet Explorer versions 6, 7, and 8. While modern browsers like Firefox, Safari, Chrome, and Opera support the canvas tag natively for 2D drawing operations, ExplorerCanvas brings the same functionality to older IE browsers ...
Read MoreHTML DOM Input Number stepUp() Method
The HTML DOM Input Number stepUp() method is used to increment the value of a number input field by a specified amount. This method provides a programmatic way to increase numeric values, which is particularly useful for creating custom increment controls or automated value adjustments. Syntax Following is the syntax for the stepUp() method − numberInputObject.stepUp(stepValue) Parameters The stepUp() method accepts the following parameter − stepValue (optional) − A number specifying how much to increment the input value. If omitted, the default value is 1. Return Value This ...
Read MoreHTML DOM Input Number disabled Property
The HTML DOM Input Number disabled property is used to get or set whether an input field of type="number" is disabled or not. When an input number field is disabled, it becomes non-interactive and cannot receive user input, and its value is not submitted with the form. Syntax Following is the syntax for returning the disabled property − object.disabled Following is the syntax for setting the disabled property − object.disabled = true | false Property Values The disabled property accepts the following boolean values − true − ...
Read MoreHTML DOM Input Number name Property
The HTML DOM Input Number name property returns and modifies the value of the name attribute of an input field with type="number". The name attribute identifies the input field when form data is submitted to the server. Syntax Following is the syntax for returning the name value − object.name Following is the syntax for modifying the name value − object.name = "text" Return Value The name property returns a string representing the value of the name attribute of the input number field. Example − Getting Name Property ...
Read MoreHTML DOM Input Number readOnly Property
The HTML DOM Input Number readOnly property sets or returns whether a number input field is read-only. When set to true, the input field becomes non-editable but remains focusable and its value can still be selected and copied. Syntax Following is the syntax to return the readOnly property − object.readOnly Following is the syntax to set the readOnly property − object.readOnly = true | false Property Values true − The input field is read-only and cannot be modified by the user. false − The input field is editable ...
Read More