I want to get div
height in inches.
I'm using this code but this is not returning correct values
<div id="test" style="width:2in;height:3in"></div>
Here is a javascript code.
var dpi_x = document.getElementById('test').offsetWidth;
var dpi_y = document.getElementById('test').offsetHeight;
var width = screen.width / dpi_x;
var height = screen.height / dpi_y;
console.log(width);
console.log(height);
Check it by yourself this is not return 2
and 3
inches.