Connect with us

Javascript

How to embed youtube video in html without iframe?

How to embed youtube video in html without iframe
Spread the love

In this blog, we will be looking at How to embed youtube video in html without using iframe. There are multiple ways to embed videos into the website without iframes.

We will demonstrate 2 simple methods for adding youtube videos in a webpage. It is quite simple html code & it is similar to adding iframes. Only the Html tag changes in case of non iframes.

Here are the 2 HTML tags for playing videos into a website.

Method 1 – HTML :-

    <embed style="width: 500px; height: 300px;"
        src="https://www.youtube.com/embed/zTk7G73kbHo">

Result :-

How to embed youtube video in html without iframe

Method 2 – HTML :-

    <object
        style="width: 500px; height: 300px;"
        data="http://www.youtube.com/embed/zTk7G73kbHo">
    </object>

Result :-

How to embed youtube video in html without iframe


Spread the love
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *