Unexpected end of file while searching for ']' to end attribute selector
<p>I dont understand what would be the problem with the following code. It needs to copy image's id value to another textbox but instead I get an error.</p>

<p>Unexpected end of file while searching for ']' to end attribute selector.</p>

<pre><code>&lt;script&gt;
$(function() { 
    $(".floatLeft").click(function() {
       var id = $(this).attr("id").replace(/\D/g, "");
       $("input[name='photo[" + id + "]'").val(Math.abs($("input[name='photo[" + id + "]'").val() - 1));
    });
});
&lt;/script&gt;

      &lt;ul class="thumbs"&gt;

        &lt;li&gt;
                &lt;img src="/FLPM/media/news/images/2M9Y1I2K_sm.jpg" alt="Garden" id="28" class="floatLeft" /&gt;
                &lt;input type="text" name="photo28" value="0" /&gt;

            &lt;br /&gt;
            &lt;a href="?Process=&amp;IMAGEID=28" class="thumb"&gt;&lt;span class="floatLeft"&gt;DELETE&lt;/span&gt;&lt;/a&gt;
        &lt;/li&gt;

        &lt;li&gt;
                &lt;img src="/FLPM/media/news/images/2A9L1V2X_sm.jpg" alt="Frangipani Flowers" id="27" class="floatLeft" /&gt;
                &lt;input type="text" name="photo27" value="0" /&gt;
            &lt;br /&gt;
            &lt;a href="?Process=&amp;IMAGEID=27" class="thumb"&gt;&lt;span class="floatLeft"&gt;DELETE&lt;/span&gt;&lt;/a&gt;

        &lt;/li&gt;
    &lt;/ul&gt;
</code></pre>
