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 234 of 840
HTML DOM Input Text form Property
The HTML DOM Input Text form property returns a reference to the form element that contains the input text field. If the input text field is not enclosed within a form element, this property returns null. This is a read-only property that provides access to the parent form for validation, submission, or other form-related operations. Syntax Following is the syntax for the input text form property − textObject.form Return Value The form property returns − A Form object reference if the input text field is contained within a form element null ...
Read MoreHTML Location assign( ) Method
The HTML Location assign() method loads a new document at the specified URL. Unlike setting window.location.href directly, this method explicitly adds an entry to the browser's history, allowing users to navigate back to the previous page using the back button. Syntax Following is the syntax for the Location assign() method − location.assign(URL) Parameters The method accepts the following parameter − URL − A string representing the absolute or relative URL of the page to navigate to. Return Value This method does not return any value. It performs navigation ...
Read MoreHTML DOM Input Text name Property
The HTML DOM Input Text name property is used for setting or returning the name attribute of an input text field. The name attribute helps in identifying form data after it has been submitted to the server and is essential for form processing. Syntax Following is the syntax for setting the name property − textObject.name = "name" Following is the syntax for getting the name property − var name = textObject.name Here, textObject is a reference to the input text element, and name is a string specifying the name attribute ...
Read MoreHTML DOM Input Text object
The HTML DOM Input Text object represents an element with type="text" in the Document Object Model. This object provides properties and methods to dynamically create, access, and manipulate text input fields using JavaScript. We can create an Input Text object using createElement() and access existing text inputs using getElementById() or other DOM selection methods. Syntax Following is the syntax for creating an Input Text object − var inputElement = document.createElement("INPUT"); inputElement.setAttribute("type", "text"); Following is the syntax for accessing an existing Input Text object − var inputElement = document.getElementById("textFieldId"); ...
Read MoreHTML onafterprint Event Attribute
The HTML onafterprint event attribute is triggered when a page has started printing or if the print dialog box has been closed in the HTML document. This event is useful for restoring page styles or displaying messages after the print operation is completed. Syntax Following is the syntax for the onafterprint event attribute − The script parameter contains JavaScript code or a function call that executes after printing occurs. Parameters The onafterprint event attribute accepts the following parameter − script − A JavaScript function or code that runs when ...
Read MoreHTML DOM Input Text placeholder property
The HTML DOM Input Text placeholder property is used for setting or returning the placeholder attribute value of an input text field. The placeholder property provides a hint to users about the expected input by displaying greyed-out text inside the input field before any user input. Unlike the value property, placeholder text is not submitted with the form data. Syntax Following is the syntax for setting the placeholder property − textObject.placeholder = "text" Following is the syntax for getting the placeholder property − var placeholderText = textObject.placeholder Here, text represents ...
Read MoreHTML DOM Input Text required property
The HTML DOM Input Text required property is associated with the required attribute of an element. This property allows you to set or check whether a text field must be filled before form submission. When a required field is left empty, the browser prevents form submission and displays a validation message. Syntax Following is the syntax for setting the required property − textObject.required = true|false Following is the syntax for getting the required property − var isRequired = textObject.required; Property Values The required property accepts boolean values − ...
Read MoreHTML DOM small object
The HTML DOM small object represents the HTML element in the Document Object Model. The element is used to display text in a smaller font size, typically for disclaimers, copyright notices, or fine print. Through the DOM, we can dynamically create, access, and manipulate small elements using JavaScript. Syntax Following is the syntax for creating a small object − var smallElement = document.createElement("SMALL"); Following is the syntax for accessing an existing small element − var smallElement = document.getElementById("smallId"); Creating a Small Element The createElement("SMALL") method creates a ...
Read MoreHTML DOM source object
The HTML DOM source object represents the HTML element in the Document Object Model. The element is used to specify multiple media resources for media elements like , , and . We can create and access source elements using DOM methods like createElement() and getElementById() respectively. The source object allows developers to dynamically add media sources to enhance browser compatibility by providing alternative formats for different devices and browsers. Syntax Following is the syntax for creating a source object − var sourceElement = document.createElement("SOURCE"); Following is the syntax for accessing an ...
Read MoreHTML DOM Span object
The HTML DOM Span object represents the HTML element in the Document Object Model. The element is an inline container used to group text or other inline elements for styling or scripting purposes. We can create new span elements dynamically using JavaScript or access existing ones to manipulate their content and properties. Syntax Following is the syntax for creating a span object − var spanElement = document.createElement("SPAN"); Following is the syntax for accessing an existing span object by ID − var spanElement = document.getElementById("spanId"); Following is the syntax ...
Read More