【发布时间】:2013-09-07 17:23:17
【问题描述】:
我在 blogspot.com 中都有某些图像,我想通过特定 div 下的 Javascript 将类名附加到它。
例如:-
<div class="outer-post">
<img src="http://1.bp.blogspot.com/1.jpg" width="200" height="200" />
<!-- more images -->
<img src="http://1.bp.blogspot.com/100.jpg" width="200" height="200" />
</div>
我想全部转换为:-
<div class="outer-post">
<img src="http://1.bp.blogspot.com/1.jpg" class="myPic" width="200" height="200" />
<!-- more images -->
<img src="http://1.bp.blogspot.com/100.jpg" class="myPic" width="200" height="200" />
</div>
这可能吗?
【问题讨论】:
-
请贴出你目前尝试过的代码。
标签: javascript jquery append