How can i get css contains of an element.
When i use alert(document. getElementById( 'mydiv').style. opacity) it will return empty.
When i use alert(document. getElementById( 'mydiv').style. opacity) it will return empty.
Code:
<style> #mydiv{ background:#000000; opacity:0.4; } </style> <div id="mydiv">inner</div>
Code:
<script> function getOpacity(){ alert(document.getElementById('mydiv').style.opacity); // it returns an empty message box } </script>
Comment