<div id="box_lol_container1" class="box_lol_container" style="overflow: auto;">
<div class="lol_div" style="display: block;">image-1.jpg </div>
<div class="lol_div" style="display: none">image-2.jpg </div>
<div class="lol_div" style="display: none">image-3.jpg </div>
<input type="text" id="input" value='' />
<script type="text/javascript">
var input = document.getElementById('input');
var container = document.getElementById('box_lol_container1');
var lol_divs = document.getElementsByClassName('lol_div');
for(var i=0;i<lol_divs.length; i++) {
var lol_div = lol_divs[i];
var computedStyle = getComputedStyle(lol_div)|| lol_div.currentStyle;
if(computedStyle.display == 'block') {
input.value = lol_div.innerHTML;
}
}
__________________
"I don't write to say what I think, but to know what I think"
Последний раз редактировалось eirnvn, 13.10.2012 в 11:15.
|