The "official" HTML element to embed media is <object>. However, to have a cross-browser site, usually an <embed> object is embedded within the <object> element. To make accessing the embedded object as easy as possible, the <object> element's id attribute should match the <embed> object's name attribute: <object class > <embed name="media"></embed> </object> Then, you can access the embedded media using the shortcut from the beginning of this phrase. Of course, you could also use document.getElementById() to access the <object> element; all <embed> elements reside in the document.embeds array. As you can see, the shortcut is much more convenient here. |