Checking if video source is empty
I have 20 videos displaying onto screen. How can I check if any of the video src's tags are empty <source src="" type="video/mp4" />
Here's my script so far
- $('video').children().each(function(index) {
- //console.log(index + " " + $(this).attr('src'));
- if($(this).attr('src').length == 0){
- console.log('hide' + index + " " + $(this).attr('src'));
- $('.row-5 div.col-1-5 .icon').addClass('disable');
- $('a.icon').removeAttr('href');
- $('div.vid').hide();
- } else {
- console.log('show' + index+ " " + $(this).attr('src'));
- $('.row-5 div.col-1-5 .icon').addClass('undisable');
- $('div.vid').show();
- }
- });