<div name='s_div'></div>
<div name='s_div'></div>
<div name='s_div'></div>
<div name='not_s_div'></div>
<div name='s_div'></div>
<script>
var specialDivs = document.getElementsByName('s_div')
var l = specialDivs.length;
for (i = 0; i < l; i++) specialDivs[i].innerHTML = 'special'
document.getElementsByName('not_s_div')[0].innerHTML = 'not_special'
</script>