attr 修改IMG src

jQuery修改img的src的方法:
$("#img_id").attr("src","new_src");

定义和用法

attr() 方法设置或返回被选元素的属性值。

根据该方法不同的参数,其工作方式也有所差异。

posted on 2017-02-26 19:40  童彪  阅读(5546)  评论(0编辑  收藏  举报

导航