Reputation: 14250
I am trying to check if the selected element is an video.
MY html
<div class='component'>
<video><source.../></video>
</div>
My js
$('.component').on('click', function(){
var newElement = $(this).children().first(); //I need to keep the children().first() for
other purpose
if(newElement.find('video').length){ //this will never be true..
alert('is video')
}
})
How do I detect if the newElement
is an video
tag? Thanks a lot!
Upvotes: 0
Views: 46