HTML Scripting and Embedding Overview

HTML Scripting and Embedding

1. Script (<script>)

The <script> tag is used to embed or reference JavaScript code in the HTML document. It can be placed in the <head> or <body> section.

HTML Example:

<script>
    document.addEventListener('DOMContentLoaded', function() {
        alert('Page Loaded!');
    });
</script>

Explanation:

2. Noscript (<noscript>)

The <noscript> tag defines content to be displayed if the user's browser does not support scripting or if scripting is disabled.

HTML Example:

<noscript>
    

Your browser does not support JavaScript or it is disabled. Please enable JavaScript for a better experience.

</noscript>

Explanation:

3. Iframe (<iframe>)

The <iframe> tag is used to embed another HTML document within the current document. It creates an inline frame.

HTML Example:

<iframe src="https://www.example.com" width="600" height="400" frameborder="0"></iframe>

Explanation:

4. Object (<object>)

The <object> tag is used to embed external resources like images, videos, and other media or documents.

HTML Example:

<object data="movie.mp4" type="video/mp4" width="600" height="400">
    

Your browser does not support this video format.

</object>

Explanation:

5. Embed (<embed>)

The <embed> tag is used to embed external content like multimedia or interactive elements directly into the page.

HTML Example:

<embed src="example.swf" type="application/x-shockwave-flash" width="600" height="400">

Explanation:

6. Param (<param>)

The <param> tag is used within the <object> tag to define parameters for the embedded object.

HTML Example:

<object data="example.swf" type="application/x-shockwave-flash" width="600" height="400">
    <param name="autoplay" value="true">
    <param name="loop" value="true">
    </object>

Explanation:

Previous Next
Modern Footer