I am working with obtaining the size of height and width of an image
I start from an image that I know what its sizes are
width 2160px
height 3840px
My code in javascript
//Quitamos el ancho y alto que tiene en el navegador para obtener el tamaño original
$('#imagen').removeAttr("width");
$('#imagen').removeAttr("height");
alert('ancho'+$('#imagen').width()+'X alto'+$('#imagen').height());
question what is the unit of measure that returns?
In the jQuery documentation for
.height()
(and in parallel for.width()
) it is specified that the values returned are in pixels but without units (bold type put by me to highlight):Which can be translated as: