Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM Embed src Property

  • Last Updated : 16 Oct, 2019

The HTML DOM Embed src Property is used to set or return the value of the src attribute in an embed element. This attribute specifies the address of the external file to embed.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

  • Return the src property:
  • Set the src property:
    embedObject.src = URL

Property Values:

  • URL: Specify the URL of the external file to embed.
    Possible Value:

    • Absolute URL: points to another web site
    • relative URL: points to a file within a web site.

    Return Value: A String which is represent the URL of the embedded file. Returns the entire URL with the protocol.


    <!DOCTYPE html>
        <title>HTML DOM Embed src Property</title>
            <h1 style="color:green">
            <embed id="embedID" 
            <button onclick="GFGfun()">
              Try it
            <p id="pid"></p>
                function GFGfun() {
                    var idsrc = document.getElementById("embedID").src;
                    document.getElementById("pid").innerHTML = idsrc;


    Supported Browsers: The browsers supported by HTML DOM Embed src Property are listed below:

    • Google Chrome
    • Internet Explorer
    • Firefox
    • Apple Safari
    • Opera

    My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!