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 103 of 151
HTML data Attribute
The data attribute of the element specifies the URL of the resource to be embedded in the web page. This resource can be various file types including audio, video, PDF documents, Flash files, images, or other multimedia content. Syntax Following is the syntax for the data attribute − Here, url is the absolute or relative URL of the resource to be embedded by the object element. Parameters The data attribute accepts a single parameter − url − A string that specifies the URL of the resource. This can ...
Read MoreHTML DOM Anchor port Property
The HTML DOM Anchor port property is used to set or return the port number of a URL in the href attribute of an anchor element. This property represents the port number portion of the URL, which appears after the hostname and is separated by a colon. Syntax Following is the syntax to set the port property − anchorObj.port = portNumber Following is the syntax to return the port property − anchorObj.port Here, portNumber is a string representing the port number of the URL. If no port is specified in ...
Read MoreHTML cancelable Event Property
The cancelable event property in HTML determines whether an event can be canceled using the preventDefault() method. It returns true if the event is cancelable and false if it cannot be canceled. This property is particularly useful when you need to check if an event's default behavior can be prevented before attempting to call preventDefault(). Syntax Following is the syntax for the cancelable event property − event.cancelable Return Value The cancelable property returns a boolean value − true − The event is cancelable and its default action can be prevented. ...
Read MoreHTML DOM activeElement Property
The HTML DOM activeElement property is a read-only property that returns the currently focused element in the document. This property is useful for tracking user interaction and determining which element has keyboard focus at any given time. When no specific element has focus, the activeElement property typically returns the element or the element, depending on the browser. Syntax Following is the syntax for the activeElement property − document.activeElement Return Value The activeElement property returns an Element object representing the currently focused element in the document. If no element has focus, ...
Read MoreHTML DOM paddingLeft Property
The HTML DOM paddingLeft property is used to get or set the left padding of an HTML element. This property allows you to dynamically modify the spacing inside an element from the left side using JavaScript. Syntax Following is the syntax for getting the paddingLeft property − object.style.paddingLeft Following is the syntax for setting the paddingLeft property − object.style.paddingLeft = "value" Return Value The paddingLeft property returns a string representing the left padding value of the element, including the unit (e.g., "20px", "2em", "5%"). Property Values The ...
Read MoreHTML DOM Input Button name Property
The HTML DOM name property is used to get or set the value of the name attribute of an input button element. This property is essential for form data submission, as the name attribute identifies the button when the form is submitted to the server. Syntax Following is the syntax for returning the name value − object.name Following is the syntax for setting the name value − object.name = "text" Here, text represents the new name value to be assigned to the input button. Return Value The name ...
Read MoreHTML DOM Input Button disabled Property
The HTML DOM Input Button disabled property returns and modifies the value of the disabled attribute of an input button element. When set to true, the button becomes non-interactive and appears grayed out. When set to false, the button is enabled and can be clicked. 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 − Disables the button, making ...
Read MoreHTML DOM History length Property
The HTML DOM History length property returns the number of URLs in the browser's session history list for the current window. This includes all pages visited during the current browsing session, including the current page. Syntax Following is the syntax for the History length property − history.length Return Value The history.length property returns an integer representing the total number of entries in the session history stack. This count includes − The current page All previously visited pages in the current tab/window session Pages navigated to using browser back/forward buttons ...
Read MoreHTML DOM HTML Object
The HTML DOM HTML Object represents the element of an HTML document. This object provides access to the root element that contains all other HTML elements on the page, including the and sections. The HTML object is useful for accessing document-wide properties, manipulating the entire document structure, or retrieving all content within the HTML element. It serves as the top-level container for all page elements. Syntax Following is the syntax to access the HTML object using getElementsByTagName() − document.getElementsByTagName("HTML")[0] Alternative syntax using documentElement property − document.documentElement ...
Read MoreHTML DOM Input FileUpload required Property
The HTML DOM Input FileUpload required property sets or returns whether a file upload field must be filled out before submitting a form. This property reflects the HTML required attribute and is a boolean value that determines form validation behavior. Syntax Following is the syntax for returning the required property − object.required Following is the syntax for setting the required property − object.required = true|false Parameters The required property accepts boolean values − true − The file upload field is required and must be filled before form ...
Read More