$("#td_id").attr('class','newClass');
If you want to add a class, use .addclass() instead, like this:
$("#td_id").addClass('newClass');
Or a short way to swap classes using .toggleClass():
$("#td_id").toggleClass('change_me newClass');
Here's the full list of jQuery methods specifically for the class attribute.
Apply to entire document when you do not have an ID selector
$(document).ready(function(){ $('.blue').removeClass('blue').addClass('green');});