ChipChamp007 Posted February 10, 2007 Share Posted February 10, 2007 Sorry if this is a really easy question... How do I change the src attribute of this code: <embed src="" autostart=false loop=false width="100%" height="45" name="radiosound">in JavaScript? Link to comment Share on other sites More sharing options...
jesh Posted February 13, 2007 Share Posted February 13, 2007 I've never tried this, but it should work. First, you'd have to have a way to get access to the element. Typically, the easiest way is to assign an ID to it: <embed id="myembed" src="" autostart=false loop=false width="100%" height="45" name="radiosound"> Once you've done that, you can get at it using the getElementById() method on the document: var embed = document.getElementById("myembed");embed.src = "http://www.mysite.com/myfile.swf";embed.width = "100%";embed.height = "45";// etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now