Uncaught SyntaxError: Unexpected identifier in document.ready
<p>I know this is a commonly asked question on here but I have done my research on the previously answered ones but can't seem to find my error. </p>

<p>As part of the app that I am making, as the page is loaded the document.ready function is supposed to look through each list item in an unordered list, check to see if the id contains the word 'video', and if it does then carry out some actions.</p>

<p>However, my code keeps getting the same error:</p>

<pre><code>Uncaught SyntaxError: Unexpected identifier 
</code></pre>

<p>After fiddling with the code for a bit, the error disappears when I take out the :contain part but after checking the jQuery docs I thought I was using it correctly.</p>

<p>Any help you could give me would be massively appreciated:</p>

<p>Code:</p>

<pre><code>$(document).ready(function() {
    $('ul.thumbnails li a img').each(function() {
        if($(this).attr('id'):contains('video')){
            var $parent = $(this).closest('a');
            $parent.remove();
        }
    });
});
</code></pre>

<p>PS another instance in my code that uses :contains but also throws up this error</p>

<pre><code>$(".span4 img").click(function(){
    if($(this).attr('id'):contains('video')){
    var id = $(this).attr('id').replace(/video/, '');
    console.log(id);
    $(this).addClass('hideicon');
    $(this).parent('.span4').prepend('&lt;video id="vid&gt;&lt;/video&gt;');
    $(this).siblings("video").trigger("play");
    $("video#vid" + id).bind("ended", function() {
           $("#video" + id).removeClass('hideicon');
           $("video#vid" + id).remove();
    });

    }

});
</code></pre>
