是否可以在td标签之间加载新数据并使用jQuery更改td标签的背景图像?如果我给每个标签添加了ID?

如果是这样,会怎么做?

有帮助吗?

解决方案

// set the background of all td tags
$('td').css('backgroundImage', 'url('+url+')');

// set the content of a particular tag
$('td#someID').html(yourHtml);

// set the background and content of a specific tag
$('td#someID').html(yourHtml).css('backgroundImage', 'url('+url+')');

所有这些都在jQuery网站上详细记录: http://docs.jquery.com/

scroll top