Can we set attributes of HTML5 tags like target or src using javascript?
<p>I am new to this forum. I am facing a small problem in passing "target" attribute into embed vlc TAG.
Please look into the below code and help me out..</p>

<p>I tried to change the "width" attribute and it is being change successfully.
I don't understand why there is a problem with "target" only.
But it works if we just add the target directly in the embed tag.</p>

<p>Please help me out.</p>

<p>My aim is to be able to pass different file paths so as to view the video I wanted.
I tried using video tag and change its src attribute but that,s not working too.
Here is the code</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script language="javascript"&gt;

window.onload = function() 
{
document.getElementById("player").width = "800";
//document.getElementById("player").target = "sample.mp4";
document.getElementById("player").setAttribute("target","sample.mp4"); // only this attribute is not being passed
alert(document.getElementById("player").getAttribute("target")); // I am also getting the alert as 'sample.mp4'
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;embed type="application/x-vlc-plugin" id="player" name="VLC" autoplay="yes" loop="no" volume="100" width="640" height="480" /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
