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 92 of 151
HTML DOM Input Checkbox autofocus Property
The HTML DOM Input Checkbox autofocus Property sets or returns whether a checkbox should automatically receive focus when the page loads. This property corresponds to the autofocus attribute in HTML and is useful for improving user experience by directing attention to important form elements. When a checkbox has the autofocus property set to true, it will be highlighted with a focus outline as soon as the page finishes loading, without requiring user interaction. Syntax Following is the syntax for returning the autofocus property − checkboxObject.autofocus Following is the syntax for setting the autofocus ...
Read MoreHTML DOM Option text Property
The HTML DOM option text property allows you to retrieve and modify the text content of an element within a dropdown. This property is useful for dynamically updating option labels without recreating the entire select element. Syntax Following is the syntax for getting the text value − optionElement.text Following is the syntax for setting the text value − optionElement.text = "newText" Return Value The property returns a string representing the text content of the option element. When setting, it accepts a string value that becomes the new ...
Read MoreHTML DOM Input FileUpload Object
The HTML DOM Input FileUpload Object represents an element with type="file" in an HTML document. This object provides properties and methods to interact with file upload elements programmatically, allowing developers to create, modify, and access file input controls dynamically. Creating a FileUpload Object You can create a FileUpload object dynamically using JavaScript's createElement() method − Syntax var fileUploadBtn = document.createElement("INPUT"); fileUploadBtn.setAttribute("type", "file"); Alternatively, you can access an existing file input element using − var fileUploadBtn = document.getElementById("fileId"); // or var fileUploadBtn = document.getElementsByTagName("input")[0]; Properties The HTML DOM ...
Read MoreHTML DOM Input Hidden Object
The HTML DOM Input Hidden Object represents an element with type="hidden" in an HTML document. Hidden input fields are invisible to users but store data that gets submitted with forms, making them useful for maintaining state information, tokens, or IDs. Syntax Following is the syntax to create an input hidden object − var hiddenInput = document.createElement("INPUT"); hiddenInput.setAttribute("type", "hidden"); You can also access an existing hidden input element − var hiddenInput = document.getElementById("hiddenFieldId"); Properties Following are the properties of HTML DOM Input Hidden Object − ...
Read MoreHTML DOM Input Hidden value Property
The HTML DOM Input Hidden value property returns and modifies the content of the value attribute of an input field with type="hidden". Hidden input fields are invisible to users but store data that can be accessed and manipulated using JavaScript. Hidden input fields are commonly used to store temporary data, user session information, or values that need to be submitted with forms without displaying them to users. Syntax Following is the syntax for returning the value − object.value Following is the syntax for modifying the value − object.value = "text" ...
Read MoreHTML DOM Input Image Object
The HTML DOM Input Image Object represents the element with type="image" in an HTML document. This object provides an interface to create and manipulate image submit buttons that can be used in forms to submit data while displaying a custom image instead of a regular submit button. The Input Image Object is particularly useful when you want to create visually appealing submit buttons using custom images, while still maintaining all the functionality of a standard form submit button. Syntax Following is the syntax to create an Input Image Object using JavaScript − var imageInput ...
Read MoreHow do I wrap text in a \'pre\' tag in HTML?
In this article, we are going to learn how to wrap text in a tag in HTML. The HTML tag is used to display preformatted blocks of text exactly as they appear in the source code, preserving all spaces, line breaks, and indentation. Preformatted text refers to content that has already been formatted and should be displayed without any additional formatting changes by the browser. The tag preserves whitespace and uses a monospace font by default, making it ideal for displaying code, poetry, ASCII art, or any text where spacing is important. Syntax Following ...
Read MoreHow to add an article in HTML5?
The article element is one of the new semantic sectioning elements introduced in HTML5. The tag represents a self-contained composition in a document, such as a blog post, news article, forum post, or any independent piece of content that makes sense on its own. The element is particularly useful for content syndication, as it identifies content that could be distributed independently from the rest of the page. Search engines and screen readers also use this semantic information to better understand page structure. Syntax Following is the syntax for the element in HTML5 − ...
Read MoreHow do we specify that the audio/video will start playing as soon as it is ready in HTML?
The autoplay attribute in HTML specifies that audio or video content should start playing automatically as soon as it is ready, without requiring user interaction. This attribute is a boolean attribute that can be applied to both and elements. Syntax Following is the syntax for the autoplay attribute − ... ... The autoplay attribute can also be written with an explicit value − ... Video Autoplay Example Following example demonstrates how to use the autoplay attribute with a video element − ...
Read MoreHow do we display the visible width of a text area in HTML?
The cols attribute in HTML is used to specify the visible width of a element. It defines how many average character widths the textarea should display horizontally before text wraps to the next line. Syntax Following is the syntax for using the cols attribute − Content Here, number represents the visible width in characters. The default value is typically 20 characters if not specified. Using the cols Attribute The cols attribute accepts a positive integer value that determines the textarea's width. A higher value creates a wider textarea, while a lower ...
Read More