0

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>
Cristian Lupascu
  • 39,078
  • 16
  • 100
  • 137

0 Answers0