Can use append but not prepend in a table td

Can use append but not prepend in a table td

I try to use the prepend method in a td but I encounter problems
My example is a visible window in a carrousel of thumbails I want to shift one position left or one position right.  

In the first case it works

    1. shiftLeft : function(){
    2. var lastNum = parseInt($(".navigation").children(":last").attr("alt"));
    3. var nextNum =lastNum+1;
    4. if(nextNum>this.nbSlide){
    5. nextNum=1;
    6. }
    7. //remove the first thumbail
    8. $(".navigation").children(":first").remove();

    9. //introduce a new thumbail at end
    10. console.log("introduce "+nextNum);
    11. $(".navigation").append('<img src='+this.src_array[nextNum-1]+' alt='+nextNum+' width="'+this.thumbWidth+'px" />');
    12. $(".navigation img").click( function(){ console.log("click");carrousel.rightLimit=false;carrousel.gotoSlide(parseInt(this.alt));})
    13. },
    The line of interrest is 14 and the append function works.

    Then I try to do the opposite
    1. //shift visible thumbails one position right
    2. shiftRight : function(){
    3. var firstNum = parseInt($(".navigation").children(":first").attr("alt"));
    4. var prevNum = firstNum-1;
    5. if(prevNum=0){
    6. prevNum=this.nbSlide;
    7. }
    8. //remove the last thumbail
    9. $(".navigation").children(":last").remove();

    10. //introduce a new thumbail
    11. console.log("introduce "+nextNum);
    12. $(".navigation").prepend('<img src='+this.src_array[prevNum-1]+' alt='+prevNum+' width="'+this.thumbWidth+'px" />');
    13. $(".navigation img").click( function(){ console.log("click");carrousel.rightLimit=false;carrousel.gotoSlide(parseInt(this.alt));});
    14. },
The line of interrest is still 14 but in this case, the prepend function doesn't work. Even the syntax coloration of the editor seems to indicate the prepend function is not allowed. ( .append turns green, but prepend doesn't).

Thank you for help ?