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 on Trending Technologies
Technical articles with clear explanations and examples
HTML DOM DT object
The HTML DOM DT object is associated with the HTML element, which represents a description term in a description list. The DT object allows you to create and manipulate elements dynamically using JavaScript, enabling interactive generation of definition lists on web pages. The element is typically used within a (description list) container alongside (description definition) elements to create structured lists of terms and their descriptions. Syntax Following is the syntax for creating a DT object − var dtElement = document.createElement("DT"); Following is the syntax for accessing an existing ...
Read MoreHTML DOM Textarea Object
The HTML DOM Textarea Object represents the element in an HTML document. This object provides properties and methods to create, access, and manipulate textarea elements dynamically using JavaScript. The textarea object is commonly used for multi-line text input in forms. Creating a Textarea Object You can create a new textarea element using the document.createElement() method − Syntax document.createElement("TEXTAREA"); Once created, you can set its properties and append it to the DOM to make it visible on the page. Properties of Textarea Object The textarea object provides numerous properties to control ...
Read MoreHow to display Base64 images in HTML?
To display images encoded with Base64, you need to get the base64 encoded string and use the img element. This prevents the page from loading slowly and saves the web browser from additional HTTP requests. Base64 images are embedded directly into HTML using Data URLs, which eliminate the need for separate image files. This technique is useful for small images, icons, or when you want to reduce HTTP requests. Syntax Following is the syntax for displaying a Base64 image in HTML − Where − [format] is the image format (jpeg, png, ...
Read MoreHTML DOM Textarea cols Property
The HTML DOM Textarea cols property gets and sets the value of the cols attribute of a textarea element. The cols attribute specifies the visible width of a textarea in average character widths. The cols property is useful for dynamically adjusting textarea dimensions through JavaScript, allowing you to change the visual width of text areas based on user interactions or content requirements. Syntax Following is the syntax to return the cols value − textareaObject.cols Following is the syntax to set the cols value − textareaObject.cols = number Here, number ...
Read MoreHow to make an element width: 100% minus padding?
Making an element occupy 100% width minus its padding is a common CSS challenge. When you set width: 100% on an element with padding, the total width becomes 100% plus the padding, causing overflow issues. There are several effective methods to achieve the desired layout. The Problem with Width: 100% and Padding By default, CSS uses the content-box model, where width: 100% applies to the content area only. Padding is added outside this width, making the total element width exceed 100% of its container. CSS Box Model: width: 100% + padding ...
Read MoreHow to link back out of a folder using the a-href tag?
When working with HTML websites that have multiple folders and subfolders, you often need to create links that navigate back to parent directories. The anchor tag with the href attribute allows you to link back out of a folder using relative or absolute paths. This article demonstrates how to create navigation links that move from a subfolder back to its parent folder. Syntax Following is the syntax for linking back to a parent folder using relative paths − Back to Parent Following is the syntax for linking using absolute paths − Back ...
Read MoreHTML DOM Bdo dir Property
The HTML DOM Bdo dir property is associated with the HTML element. Here, bdo stands for Bi-Directional Override. The tag is used to override the current text direction which is by default left to right. The bdo dir property sets or returns the dir attribute value of a element. The dir property is compulsory for the element and specifies the direction of the text flow. Syntax Following is the syntax for setting the dir property − bdoObject.dir = "ltr|rtl" Here, ltr is left-to-right text direction, whereas rtl is right-to-left text ...
Read MoreHTML DOM Input Search form Property
The HTML DOM Input Search form property returns a reference to the form element that contains the input search field. If the search field is not inside any form, it returns null. This property is read-only and helps identify the parent form of a search input for validation or manipulation purposes. Syntax Following is the syntax for the input search form property − searchObject.form Return Value The form property returns − A form object reference if the input search field is inside a form element null if the input search field ...
Read MoreHTML DOM Window frameElement Property
The HTML DOM Window frameElement property returns the HTML element that contains or embeds the current window, such as , , or . If the window is not embedded within another element (i.e., it's the top-level window), this property returns null. This property is commonly used to determine whether a page is running inside a frame or as a standalone window, and to access properties of the parent element when embedded. Syntax Following is the syntax for accessing the frameElement property − window.frameElement Return Value The frameElement property returns − ...
Read MoreUnescape HTML entities in JavaScript?
To unescape HTML entities in JavaScript, we need to understand the difference between URL encoding (handled by unescape()) and HTML entity decoding. HTML entities like , and & require different approaches than URL-encoded strings like %20. The legacy unescape() function only handles URL percent-encoded strings, not actual HTML entities. For true HTML entity decoding, we use modern methods like the DOM's innerHTML property or DOMParser. Syntax Following is the syntax for the legacy unescape() function for URL decoding − unescape(encodedString) Following is the syntax for HTML entity decoding using DOM methods − ...
Read More