嗨,我想访问 javascript 中某个特定 div 下的所有图像。我的代码是:
<div id="image-container" style="background-image:url(loading.gif)">
<div class="fade-box" id="image-1"><a href="javascript:GoNext();"><img src="2bscene-logo.gif" alt="" width="330" height="108" border="0" /></a></div>
<div class="fade-box" id="image-2" style="display: none;"><a href="javascript:GoNext();"><img src="streetgallery-logo.gif" alt="" width="330" height="108" border="0" /></a></div>
<div class="fade-box" id="image-3" style="display: none;"><a href="javascript:GoNext();"><img src="g4m-logo.gif" alt="" width="330" height="108" border="0" /></a></div>
</div>
虽然我的 js 代码是:
var image_slide = new Array('image-1', 'image-2', 'image-3');
我想动态地获取所有DIV
s id
,而不是预定义的数组。我怎样才能做到这一点?