При стиле, заданном в html
<div id = "d1" style="opacity:0;"></div>
<div id = "d2" style="opacity:0.5;"></div>
<div id = "d3" style="opacity:1;"></div>
<div id = "d4" style="opacity:0;"></div>
<script>
var it = document.querySelector('div[style*= "opacity:1"]');
alert(it.id);
</script>