var post_div document getElementById id-div var imgs post_div getEleme

1
2
3
4
5
6
7
8
var post_div = document.getElementById("id-div");
var imgs = post_div.getElementsByTagName("img");
for (var i = 0; i < imgs.length; i++) {
imgs[i].onclick = function(){
alert('click);
}
imgs[i].style.cursor = 'pointer';
}