Found 2202 Articles for HTML

How to create headings in HTML page?

Lokesh Badavath
Updated on 11-Nov-2022 07:43:28

5K+ Views

Headings are the titles or the subtitles of the content that you want to display on the web page. Headings help us to get an idea on the content on the web page. Headings and subheadings represent the key concepts ideas and supporting ideas in the content of the web page. HTML have different level of heading tags. Heading is defined with to tags. It is important to use headings to show the HTML document structure. headings should be used for main headings, followed by headings, then , and so on up to . Syntax Following ... Read More

How to create an HTML Document?

Lokesh Badavath
Updated on 11-Nov-2022 07:38:08

21K+ Views

HTML stands for Hyper Text Markup Language. It is the most widely used language to write web page. HTML document defines the structure of web page. HTML document begins with the declaration, and the HTML documents start and end with the and tags. HTML document is split into two parts − Head Body The head which contains the information about the document title etc. The information inside this tag does not display outside (on web page). The information of the head part is placed between … tags. Example Following is the example program for the ... Read More

What are HTML 5 Standard Events?

Giri Raju
Updated on 16-Jun-2020 11:38:33

691 Views

When a user visits your website, they do things like click on text and images and given links, hover over things etc. These are examples of what JavaScript calls events.We can write our event handlers in JavaScript or VBScript and you can specify these event handlers as a value of event tag attribute. The HTML5 specification defines various event attributes as listed below −AttributeValueDescriptionOfflinescriptTriggers when the document goes offlineOnabortscriptTriggers on an abort eventonafterprintscriptTriggers after the document is printedonbeforeonloadscriptTriggers before the document loadsonbeforeprintscriptTriggers before the document is printedOnblurscriptTriggers when the window loses focusOncanplayscriptTriggers when media can start play but might to ... Read More

How to use Python Regular expression to extract URL from an HTML link?

Nikitasha Shrivastava
Updated on 26-May-2025 18:04:33

3K+ Views

In this article, we are going to learn how to extract a URL from an HTML link using Python regular expressions. URL is an acronym for Uniform Resource Locator; it is used to identify the location resource on the Internet. URL consists of a domain name, path, port number, etc. The URL can be parsed and processed by using a Regular Expression. Therefore, if we want to use a Regular Expression, we have to use the "re" library in Python. Following is an example of a URL - URL: https://www.tutorialspoint.com/courses If we parse the above URL we can find ... Read More

How to use external “.js” files in an HTML file?

Bhanu Priya
Updated on 04-Oct-2023 17:30:46

7K+ Views

What is JavaScript? JavaScript is a client-side scripting language which is used to create a dynamic webpage. It is integrated with the HTML code. JavaScript code is inserted between and tags as shown below. document.getElementById("demoId").innerHTML = "JavaScript Example"; JavaScript is a programming language that adds rich interactivity to your website (for example: games, responses when buttons are pressed or data entered in forms, dynamic styling, animation etc..). In its most common form, JavaScript resides inside HTML documents, and can provide levels of interactivity to web pages that are not achievable ... Read More

Should I write my script in the body or the head of the HTML?

Bhanu Priya
Updated on 04-Oct-2023 16:32:33

1K+ Views

In HTML, the script tag can be inserted either in head section or in body section, generally the java script code is inserted between script open and close tags. //JavaScript code here We can insert any number of scripts in an HTML document. Scripts can be placed in , or section or in both of an HTML page. Now, let’s see if there is any difference if we insert script in body or head of HTML. It is better to place the java script before closing of the tag rather than ... Read More

What is the difference between id and name attributes in HTML?

Bhanu Priya
Updated on 04-Oct-2023 16:27:25

3K+ Views

ID attribute ID is an input form element, and it has nothing to do with data contained within the element. Input element ids are for hooking the element with JavaScript and CSS. By using id attribute, we can validate and manipulate the value of an element at client side. In java script, using id attribute we can get the value of input element. document.getElementById("id").value; In CSS, ID attribute is referenced with # character. #id If we consider HTML elements, the ID attribute is unique identifier, it is a case sensitive and begins with a letter, In ... Read More

What are valid values for the id attribute in HTML?

Bhanu Priya
Updated on 04-Oct-2023 15:54:16

2K+ Views

The ID attribute in HTML is called as unique identifier for the element. It helps in identifying an area in a web page by using CSS styles, targets for scripts and anchor links. First let us see, what is the use of ID attributes in HTML − The ID attribute can perform different actions on web pages by using commands − ID attribute used to reference for scripts − In JavaScript functions, we use ID attribute for making changes to the precise element on the page with our scripts. ID attribute use for style sheet selector − Most of ... Read More

Are HTML comments inside script tags a best practice?

Bhanu Priya
Updated on 09-Nov-2023 14:29:04

2K+ Views

Before trying to understanding whether HTML comments inside script tags is best practice or not, let us discuss about how to write comments in HTML, what are the different ways to comment in HTML? Generally, comments are helpful to understand the statement, it leaves remainders and provide explanations. It also helps in disabling the statement when we are testing or working on new feature. Syntax Following is the syntax for comment representation − Let us see different ways to represent comments in a program − Inserting a single-line comment The single line comment is applied to single ... Read More

Where should I put