Html Scripting tags


HTML (Hypertext Markup Language) is used for creating the structure and presentation of web pages. While HTML is primarily focused on defining the structure and content of a web page, it also provides a few scripting tags that allow you to add interactivity and dynamic behavior to your web pages. Here are some commonly used scripting tags in HTML:

1.<script>: The <script> tag is used to embed or reference external JavaScript code within an HTML document. JavaScript is a scripting language that provides powerful functionality for manipulating web page elements, handling events, and implementing dynamic features.

example:

<script src="script.js"></script>

2.<noscript>: The <noscript> tag is used to define content that should be displayed when JavaScript is disabled or not supported by the browser.

example:

<noscript>

  <p>This page requires JavaScript to function properly.</p>

</noscript>

3.<canvas>: The <canvas> tag is used to draw graphics, animations, or other visualizations on a web page using JavaScript. It provides a drawing surface that can be manipulated through JavaScript code. For example:

<canvas id="myCanvas"></canvas>

<script>

  var canvas = document.getElementById('myCanvas');

  var context = canvas.getContext('2d');

  // JavaScript code to draw on the canvas

</script>

4.<iframe>: The <iframe> tag is used to embed another HTML document or external web page within the current document. It allows you to display content from a different source or provide an interactive widget.

example:

<iframe src="https://www.example.com"></iframe>

5.<embed>: The <embed> tag is used to embed multimedia content, such as images, audio, video, or other external applications, into an HTML document.

example:

<embed src="video.mp4" type="video/mp4" />

6.<object>: The <object> tag is used to embed external objects, such as images, audio, video, or interactive media, into an HTML document. It allows you to specify different content based on the availability of browser plugins.

example:

<object data="document.pdf" type="application/pdf"></object>

    These are just a few examples of scripting tags in HTML. Each tag serves a specific purpose and can be used to enhance the functionality and interactivity of your web pages.

Comments

Popular Posts