HTML Articles

Page 40 of 151

HTML width/height Attribute vs CSS width/height Property

Mohit Panchasara
Mohit Panchasara
Updated on 16-Mar-2026 599 Views

While developing web pages, many times, developers require to manage the size of different HTML elements such as image, div element, span element, etc. Developers can use the width and height CSS properties or HTML attributes to manipulate the dimensions of a particular element. In this tutorial, we will see the difference between the width/height HTML attribute and CSS properties. Width and Height HTML Attributes The width/height attributes in HTML are used for the presentation. It takes the width and height values in the 'px', '%', etc. units but not in 'rem' units. Also, if we don't ...

Read More

HTML DOM Bdo dir Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 200 Views

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 More

How to disable the input type text area?

Dishebh Bhayana
Dishebh Bhayana
Updated on 16-Mar-2026 946 Views

In this article, we will learn how to disable the textarea element using different methods in HTML. The element is used to create multi-line text input fields in forms. Disabling a textarea can be useful in situations where you want to display information to the user but prevent them from editing or modifying that information. For example, displaying a message or instructions in a textarea, or preventing user input during form submission to maintain data consistency. Syntax The disabled attribute is used to disable form elements including textarea − Content Or with ...

Read More

HTML DOM Bold object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 538 Views

The HTML DOM Bold object represents the HTML element in the Document Object Model. The tag is used to make text appear bold without conveying any extra importance or emphasis. The Bold object provides methods and properties to create, access, and manipulate elements dynamically using JavaScript. Syntax Following is the syntax for creating a Bold object − var boldElement = document.createElement("B"); To access an existing element by its ID − var boldElement = document.getElementById("boldId"); Properties The Bold object inherits all properties from the generic HTML ...

Read More

HTML DOM Button name Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 334 Views

The HTML DOM Button name property is associated with the name attribute of the element. The name property allows you to set or return the value of the name attribute of a button element. The name attribute is primarily used in forms to identify elements when submitting form data to the server and for accessing elements using JavaScript. Syntax Following is the syntax for setting the name property − buttonObject.name = "name" Following is the syntax for getting the name property − var name = buttonObject.name Here, name is ...

Read More

How to disable mouseout events triggered by child elements?

Dishebh Bhayana
Dishebh Bhayana
Updated on 16-Mar-2026 1K+ Views

When working with mouse events in JavaScript, the mouseout event can trigger unwanted behavior due to event bubbling. When a mouseout event occurs on a child element, it bubbles up through the DOM hierarchy and also triggers the same event on all parent elements. This creates issues when you only want to listen for mouseout events on the parent element itself, not the bubbled events from child elements. There are several effective approaches to prevent this unwanted behavior and disable mouseout events triggered by child elements. Understanding Event Bubbling Event bubbling means that when an event occurs ...

Read More

How to display a dialog box on the page?

Dishebh Bhayana
Dishebh Bhayana
Updated on 16-Mar-2026 2K+ Views

The dialog box is an essential UI component that provides feedback to users, collects input, or displays important information. HTML offers multiple ways to implement dialog boxes, from the native element to traditional JavaScript methods like prompt() and confirm(). Dialog boxes serve various purposes including user confirmations, data input forms, notifications, and authentication prompts. They help create focused user interactions by overlaying content above the main page. Syntax Following is the syntax for the HTML element − Dialog content here To control the dialog programmatically − ...

Read More

How to display a popup message when a logged-out user tries to vote?

Dishebh Bhayana
Dishebh Bhayana
Updated on 16-Mar-2026 219 Views

In this article, we will learn how to display a popup message when a logged-out user tries to vote using jQuery and various JavaScript methods. This is a common requirement in web applications where certain actions like voting, commenting, or rating should be restricted to authenticated users only. To implement this functionality, we will use the jQuery library along with HTML and CSS to create interactive popup messages. When an unauthenticated user attempts to vote, we will show an informative popup that prompts them to log in first. Syntax Following is the basic syntax for checking user ...

Read More

How to eliminate extra space before and after a form tag?

Dishebh Bhayana
Dishebh Bhayana
Updated on 16-Mar-2026 1K+ Views

When designing web forms, the form element can introduce unwanted spacing that disrupts your layout. The tag, like other block-level elements, has default browser margins and padding that create extra space above and below the form content. This extra spacing can affect the overall design and alignment of your form elements, especially when forms are placed within containers or alongside other elements. Understanding how to eliminate this space ensures a clean and compact form layout. Understanding Default Form Spacing By default, most browsers apply margins to form elements. The element typically receives a top and ...

Read More

Difference between linking an image, website, and email address in HTML

Nikhilesh Aleti
Nikhilesh Aleti
Updated on 16-Mar-2026 499 Views

In HTML, there are three common types of linking: embedding images, creating website links, and linking to email addresses. Each uses different elements and attributes to achieve specific functionality. To embed an image into a webpage, the tag is used with the src attribute. To create a hyperlink to another website, we use the anchor tag with the href attribute. To link an email address, we use mailto: inside the href attribute of the anchor tag. Linking an Image The tag embeds an image directly into the webpage. Unlike the anchor ...

Read More
Showing 391–400 of 1,509 articles
« Prev 1 38 39 40 41 42 151 Next »
Advertisements