Can anyone tell me please, why is this not working? It gives me the "undefined" value instead of true one.
function myFunction() {
var w = document.getElementById("try").outerWidth;
var h = document.getElementById("try").outerHeight;
document.getElementById("demo").innerHTML = "Width: " + w + "<br>Height: " + h;
}
<button onclick="myFunction()" id="try">Try it</button>
<p id="demo"></p>