How do I edit the src of an <object> tag using JS?
What you mean is not src ( which is part of the image ) but the path to the object, right?
<object data="myvideo.avi" type="video/x-msvideo" name="myobject">
If you want to change the path to the data it should work with:
You also need a event to change the path. To test it you can copy this into the body :
<object data="myvideo.avi" type="video/x-msvideo" name="myobject" onMouseOver='changePath()'>
<img src="file.ext" width="9" height="9" border="0" alt="" ></object>
It's using the onMouseover event to call the function changePath().
Now insert the following script to the head of the page:
The alert window shows you the content of myobject.data before and after the path is changed - it's only to test the function.
I hope this helps.