复制代码 代码如下: $(function() { $('table tr td:not(:last-child)').mouseover(function() { val = $(this).text().trim(); $(this).attr({title:val}); }) });