Click Me!
Click Me!
Click Me!
Click Me!
Click Me!
Click Me!
var g = document.getElementById('my_div');
for (var i = 0, len = g.children.length; i < len; i++)
{
(function(index){
g.children[i].onclick = function(){
alert(index) ;
}
})(i);
}
'web > javascript' 카테고리의 다른 글
Javascript arrow function expression (0) | 2019.07.12 |
---|---|
Replace Tag(Script & div & B tag to strong) (0) | 2019.07.12 |
Javascript Async, Await 심화 (0) | 2019.07.12 |
Javascript Async return Promise For await (0) | 2019.07.12 |
ECMA6 (0) | 2019.01.30 |
댓글