HTML Concepts - Q&A
HTML Concepts - Q&A
1. What is HTML?
3. Can you share examples of other markup languages and how they differ from
HTML?
LaTeX: LaTeX is a markup language that is commonly used in the scientific and
technical fields to create high-quality documents. It is known for its ability to typeset
complex mathematical equations and symbols, as well as for its support for cross-
referencing and bibliographies.
One common use for data- attributes is to store data that is used by JavaScript to
manipulate the element in some way. For example, you might use a data- attribute
to store the id of a database record that is associated with the element, and then use
JavaScript to retrieve and update the record when the element is clicked.
Here is an example of a data- attribute being used to store a custom data value:
Code
<div data-record-id="123">This element is associated with record 123</div>
In this example, the data-record-id attribute is used to store the id of a record that is
associated with the div element. The value of the attribute, "123", is the id of the
record. This attribute could then be accessed and used by JavaScript to retrieve and
update the record as needed.
data- attributes are a useful way to store custom data on an HTML element in a way
that is private to the page or application. They can be used to store data that is used
by JavaScript or other client-side scripts, or to store data that is used by the server
when the page is submitted.
7. Describe the difference between &<script>, <script async> and <script defer>.
The <script> element is used to include a script in an HTML document. The script can
be a JavaScript file, or it can contain JavaScript code directly inline in the element.
There are several attributes that can be used with the <script> element to control
how the script is loaded and executed. These attributes include:
Using the async or defer attributes can improve the performance of your page, since
it allows the browser to load and execute the script in a way that does not block the
rendering of the page. However, you should be careful when using these attributes,
as they can also change the order in which your scripts are executed, which may
affect the behavior of your page.