Reputation: 44403
console.log(video);
puts in my console the following line:
<object type="application/x-shockwave-flash" class="video" data="http://www.youtube.com/v/vyFAF-J3jzM" width="308" height="100" id="video" style="visibility: visible; ">…</object>
So "video" holds the entire dom-object. How can I query the ID of this object with JavaScript?
Something like var vidID = video.getId();
Upvotes: 45
Views: 106440
Reputation: 30131
var videoElement = document.getElementById('video');
var idOfElement = videoElement.getAttribute('id');
Upvotes: 45