The HTML DOM emphasized object represents the HTML element in the Document Object Model. The element is used to emphasize text content, typically rendering it in italic style to indicate stress or importance. You can create and access emphasized objects using the createElement() and getElementById() methods respectively. Syntax Following is the syntax for creating an emphasized object − var emphasisElement = document.createElement("EM"); Following is the syntax for accessing an existing emphasized object − var emphasisElement = document.getElementById("elementId"); Properties The emphasized object inherits all standard HTML element properties ... Read More
Creating a 2-column layout with full-height background colors can be challenging when columns contain different amounts of content. The key is ensuring both columns stretch to match the height of the tallest column, preventing uneven background colors. Modern CSS provides several effective methods to achieve equal-height columns with full background colors, including Flexbox, CSS Grid, and CSS Table Display. Each approach has its advantages for different use cases and browser support requirements. Why Column Heights Matter When creating two columns with different content lengths, the shorter column's background color typically stops at its content height, creating an ... Read More
The HTML checkbox is created using the element to define square boxes that users can tick (check) when activated. Checkboxes allow users to select one or more options from a limited set of choices. Making a checkbox with a clickable label improves user experience by allowing users to click on the label text to toggle the checkbox state. Syntax Following is the basic syntax for creating a checkbox − To create a clickable label for the checkbox − Label Text Or using the for attribute − ... Read More
The mailto form is a special type of HTML form that uses an email client to send form data directly via email instead of submitting to a web server. When the form is submitted, it opens the user's default email application with the form data pre-filled in the email body. Mailto forms are particularly useful for simple contact forms on static websites where server-side processing is not available. They provide an easy way for visitors to send feedback, questions, or suggestions directly to a specified email address. Syntax The basic syntax for creating a mailto form uses ... Read More
The HTML DOM Legend form property returns a reference to the form element that contains the element. This property is read-only and provides access to the parent form for DOM manipulation and validation purposes. Syntax Following is the syntax for accessing the form property − legendObject.form Return Value The form property returns a reference to the HTMLFormElement object that contains the legend, or null if the legend is not inside a form. Example Let us see an example demonstrating the Legend form property − ... Read More
Bootstrap is a popular front-end framework that makes it easier to design and develop responsive and mobile-first websites. It provides several components and plugins that can be used to create an add-to-cart button with modal confirmation functionality. The framework contains pre-built styles and interactive components that can save time and effort in building e-commerce interfaces. An add-to-cart button is a crucial element in e-commerce websites that allows users to select products for purchase. When combined with Bootstrap's modal component, it provides immediate feedback to users confirming their action. Basic Add to Cart Button The simplest approach uses ... Read More
The HTML DOM Legend Object represents the element in the Document Object Model. The element provides a caption or title for its parent element, helping to group related form controls together with a descriptive label. Syntax Following is the syntax for creating a element using JavaScript − var legendObject = document.createElement("LEGEND"); To access an existing element − var legendObject = document.getElementById("legendId"); Properties The Legend Object has the following property − Property Description form Returns a reference ... Read More
The data() method in jQuery is used to fetch values of custom data attributes from HTML elements and manages an internal cache system. The attr() method is used to get or set standard HTML attributes and directly manipulates the DOM. Understanding when to use each method is crucial for effective jQuery development. Syntax Following is the syntax for the jQuery data() method − $(selector).data(key); // Get data $(selector).data(key, value); // Set data Following is the syntax for the jQuery attr() method − ... Read More
Word wrapping is the process of automatically moving text to the next line when it reaches the edge of its container. In HTML, text within an element wraps according to the boundaries of that element by default. However, there are situations where you may want to disable word wrapping to keep text on a single line or preserve specific formatting. Default Word Wrapping Behavior By default, HTML elements wrap text content when it exceeds the container's width. Let us see this behavior with an example − Default Word Wrapping ... Read More
The HTML DOM Form submit() method is used to programmatically submit form data to the server address specified by the action attribute. This method acts like clicking a submit button, triggering form submission without user interaction. Syntax Following is the syntax for the Form submit() method − formObject.submit() Parameters The submit() method does not take any parameters. Return Value The method does not return any value. It simply submits the form data to the server. Example − Basic Form Submission Following example demonstrates how to use the submit() method ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Economics & Finance