Found 2202 Articles for HTML

How div class and id is useful in HTML ?

Nikhilesh Aleti
Updated on 04-Aug-2023 16:46:50

444 Views

The HTML tag represents a division or section in an HTML document. This tag is used as a container, inside this we can embed any of the HTML elements (such as texts, images, tables, audio, video, etc.). If we want to style or interact with the element, we can assign an id or class attribute. Note − By default, most browsers always add a new line break before and after the element. HTML id Attribute In HTML, using the id attribute (global attribute), we can specify a unique identifier for any HTML element. We cannot assign more ... Read More

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

Nikhilesh Aleti
Updated on 04-Aug-2023 16:41:19

413 Views

In this article, we are going to discuss the difference between linking an image, website, and email address in HTML. To link or embed an image into a website, the tag is used. To link a website, we use anchor tag with href (hypertext reference) attribute. To link an email address, we use mailto inside the href attribute of anchor tag. Linking an Image In HTML, we use the tag to embed or link an image to a website. This tag requires "src" attribute for the path of the image that we want to ... Read More

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

Dishebh Bhayana
Updated on 03-Aug-2023 21:17:47

916 Views

In this article, we will learn how to eliminate extra space before and after a form HTML element so as to ensure a clean and compact form layout. When designing web applications, it's essential to have control over the spacing and layout to create a visually pleasing and well-organized user interface. Sometimes, there is extra space available before and after a tag, which can affect the overall design and alignment of your form elements. Let’s understand how to remove the extra space with the help of some examples. Example 1 In this example, we will remove the extra space ... Read More

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

Dishebh Bhayana
Updated on 03-Aug-2023 19:09:26

166 Views

In this article, we will learn how to display a popup message when a logged-out user tried to vote using jQuery and its various methods. In many web applications, it is important to restrict certain actions to logged-in users only, for example, voting on a poll or a form. To implement this functionality, we will use the jQuery library and some basic HTML and CSS. We will show a popup message that informs the user that they need to be logged in to perform the desired action. Let’s understand the above approach with the help of an example − ... Read More

How to display a list in n columns format?

Dishebh Bhayana
Updated on 02-Aug-2023 19:35:18

1K+ Views

In this article, we will learn how to display a list in “n” column format in HTML and CSS with the help of columns, column-count, and grid CSS properties. Displaying a list in columns can be a useful way to save space and make the information more visually appealing. We can achieve this by using different approaches that rely on columns, column-count, and grid properties respectively. Let’s understand each approach in detail. Approach 1 In this approach, we will use the column-count CSS property to determine the number of columns we will divide our content into. Let’s understand ... Read More

How to display a dialog box on the page?

Dishebh Bhayana
Updated on 02-Aug-2023 19:32:15

2K+ Views

In this article, we will learn how to display a dialog box on the page using the dialog HTML tag. Dialog boxes can be a useful tool to provide feedback to users or to prompt them for input. The HTML element provides an easy way to display a dialog box on a web page. The element is not supported in all browsers, but it can be polyfilled using JavaScript to provide support for older browsers. Let’s understand how to implement a dialog box on a webpage with the help of some examples Example 1 In this example, we ... Read More

How to disable mouseout events triggered by child elements?

Dishebh Bhayana
Updated on 02-Aug-2023 19:29:14

1K+ Views

In this article, we will learn how to disable the mouseout events triggered by child elements with the help of the “mouseleave” event or using the stopPropagation method of the native HTML event. The “mouseout” event, when triggered on a child element, bubbles up in its DOM hierarchy, and so it will also trigger the same event on all its parent elements. This can be unneeded when we only want to listen to the “mouseout” event on the parent element itself, not the bubbled-up event from its child elements. Let’s understand how to avoid the above problem with the ... Read More

How to disable the input type text area?

Dishebh Bhayana
Updated on 02-Aug-2023 19:25:37

837 Views

In this article, we will learn how to disable the input type text area element with the help of a disabled attribute. Disabling an input field can be useful in situations where one wants to display information to the user but does not want the user to be able to edit or modify that information. For example, to display a message or a set of instructions in a text area element. This can also be useful in cases where one wants the user to avoid typing the content in the text area in the middle of a form submission. This ... Read More

How to disable browser Autocomplete on the web form field/input tag?

Dishebh Bhayana
Updated on 02-Aug-2023 19:07:28

305 Views

In this article, we will learn how to disable the browser autocomplete feature on the web form fields or their input elements, and we will use the “autocomplete” attributes provided by “form” and “input” HTML tags. Browser autocomplete is a feature that suggests the past values entered and submitted into the forms. By default, autocomplete is enabled in the browsers, and so when the user clicks on an input, the suggestions are visible for that input value, and the user can directly pick any of the suggestions to autofill the content. To disable this behavior, we will see ... Read More

How to prevent XSS with HTML/PHP?

Mohit Panchasara
Updated on 26-Jul-2023 12:52:45

691 Views

Cross-Site Scripting (XSS) is a major threat to web application security because it allows attackers to inject malicious scripts into reputable websites. This attack depends on innocent consumers, exposing important information or potentially gaining control of their accounts. Understanding and combating XSS threats is critical for maintaining a strong security posture as web applications become more complex and dynamic. In this article, we will dive into XSS attacks and look at possible prevention strategies. What are XSS Attacks? Cross-Site Scripting (XSS) attacks are a common security risk in web applications. Attackers take advantage of vulnerabilities in web pages to inject ... Read More

Advertisements