Código Javascript
:
Ver original- $(document).ready(function(){ 
-   $("td").click(function(){      
-     if( $(this).attr("bgcolor") == "#dddddd" ){ 
-       $(this).attr("bgcolor","#ff00ff"); 
-     } 
-     else{ 
-       $(this).attr("bgcolor","#dddddd");     
-     }    
-   }); 
- }); 
El error está aquí:   
Código Javascript
:
Ver original- if( $(this).attr("bgcolor") == $(this).attr("#dddddd") ) 
Ahí tu IF está comparando si el atributo bgcolor es igual al atributo #dddddd, que obviamente no existe.