YouTip LogoYouTip

Prop Embed Src

HTML DOM Embed src Property

HTML DOM Embed src Property |

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

HTML DOM Embed type Property

HTML DOM Embed height Property

Deep Dive

  • Web Service
  • Scripting
  • Programming
  • Scripting Languages
  • Computer Science
  • Web Design & Development
  • Web Services
  • Programming Languages
  • Software
  • Development Tools

Embed src Property

Embed Object Reference Embed Object

Example

Return the URL of the embedded file:

var x = document.getElementById("myEmbed").src;

x output will be:

http://www.w3cschool.cc/jsref/helloworld.swf

Try it yourself Β»


Definition and Usage

The src property sets or returns the value of the src attribute of an embed element.

The src property describes the external address (URL) of the embedded file.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The src property is supported by all major browsers.


Syntax

Return the src property:

embedObject.src

Set the src property:

embedObject.src=URL

Property Values

Value Description
URL Describes the external address (URL) of the embedded file. Possible values:
  • An absolute URL - points to another site (e.g., src="http://www.example.com/hello.swf")
  • A relative URL - points to a file within the site (e.g., src="hello.swf")

Technical Details

Return Value: A String, representing the URL of the embedded file. Returns the full URL, including the protocol part (http://).

Related Pages

HTML Reference: HTML <embed> src Attribute


Embed Object Reference Embed Object

← Prop Embed TypeProp Embed Height β†’