<script> window.onload = function(){ var widthImage = document.getElementById('avatar-image-container').getElementsByTagName('img')[0].width; alert(widthImage); }; </script>