изменить атрибут фона td с помощью jquery

0

У меня много td в html-документе, содержащем атрибут фона. Я хочу изменить путь фона td.Fowlowing - один из примеров td:

<td background="/v/vspfiles/templates/AlligatorPerform/images/Grid_Single_Divider_Vert.gif"> 
<img width="3" height="3" src="http://alligatorperformanceblog.com/vspfiles/templates/AlligatorPerform/images/clear1x1.gif"> 
</td>

в приведенном выше примере я хочу изменить

background="/v/vspfiles/templates/AlligatorPerform/images/Grid_Single_Divider_Vert.gif" 

в

background="http://alligatorperformanceblog.com/vspfiles/templates/AlligatorPerform/images/Grid_Single_Divider_Vert.gif"

кто-нибудь может помочь мне, как это сделать.

  • 0
    Вы хотите изменить фон каждого тд?
  • 0
    да, я хочу изменить фон всех тд, которые имеют атрибут фона
Показать ещё 2 комментария
Теги:

1 ответ

1
Лучший ответ

Используйте селектор атрибутов jquery для выбора всего td с атрибутом фона

$("td[background]").each(function(){
  $(this).attr("background","http://alligatorperformanceblog.com/vspfiles/templates/AlligatorPerform/images/Grid_Single_Divider_Vert.gif");
});
  • 1
    эй спасибо, это помогло

Ещё вопросы

Сообщество Overcoder
Наверх
Меню