Предположим, что у меня есть следующий HTML:
<img id="foo" src="bar1.jpg"/>
Я хотел бы переключить src
на bar2.jpg
Могу ли я это сделать?
$("#foo").attr("src", "bar2.jpg");
Или мне нужно это делать?
$("#foo").removeAttr("src");
$("#foo").attr("src", "bar2.jpg");
Спасибо!