The HTML tag is used for declaring a script within your HTML document. Through this, you can define client-side JavaScript. But, what if you want to add external JavaScript inside an HTML Page? Well, you can easily do that too using the src attribute of the tag.The following are the attributes of the tag −AttributeValueDescriptionasyncasyncSpecifies that the script is executed asynchronously.charsetcharsetDefines the character encoding that the script uses.deferdeferDeclares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page.srcURLSpecifies a URI/URL of an external script.typetext/JavaScript application/ecmascript ... Read More
In this article, we will learn how to use the tag to define the base URL for an HTML page. In HTML, different elements have attributes that contain link to the other resources. The values of these attributes are URL’s, these can be absolute or relative URL’s. The HTML element specifies the base URL to use for all relative URLs in a document. There can only be one single element in a document, and it must be placed inside the tag. The following are the attributes of the HTML tag − The tag must ... Read More
With HTML, the essentials are doctype declaration, and . But, you will be amazed to know that a valid HTML document can work without the and element. The doctype declaration will come always since it tells and instructs the browser about what the page is about.Let’s see an example; here we won’t use the html> and element. Still, the HTML Document is valid and will work correctly like any other valid HTML Document −
Title of the page
This is heading 1
This is heading 2
This is a paragraph.
With HTML, the essentials are doctype declaration, and . But, you will be amazed to know that a valid HTML document can work without the element. The doctype declaration will come always since it tells and instructs the browser about what the page is about.Let’s see an example; here we won’t use the tag. Still, the HTML Document is valid and will work correctly like any other valid HTML DocumentExampleLive Demo
Title of the document
This is heading 1
This is demo text.
HTML document is a web page, which helps you in showing content on the website. It consists of tags, which has an opening as well as closing tags. However, some tags do not come in pairs i.e. they do not have a closing tag. The basic minimal structure also has some tags, which you need to add.doctypeThis is a doctype declaration, which begins the HTML program and gets added as . It is added to tell and instruct the browser about the document.