You are here: Reference > JavaScript > client-side > HTML DOM > properties > dynsrc (img, input:image)

dynsrc property (img, input:image)

Browser support:
Sets or retrieves the location of a movie file or VRML.
If the dynsrc property is defined, the src property will be ignored. Do not use this property, use the object element instead.

Syntax:

object.dynsrc;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: dynsrc

Possible values:

String that sets or retrieves the URL of the file. It can be an absolute or relative path as well. Relative paths are relative to the base URL. The base URL is the location of the current document, but it can be overridden by the base tag.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the dynsrc attribute:
<img id="myImage" src="dynTest.gif" dynsrc="dynTest.mpg" />
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the dynsrc property:
<head>
    <script type="text/javascript">
        function GetDynsrc () {
            var image = document.getElementById ("myImage");

            if ('dynsrc' in image) {
                alert (image.dynsrc);
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <img id="myImage" src="dynTest.gif" dynsrc="dynTest.mpg" />
    <button onclick="GetDynsrc ();">Get dynsrc!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content