I am curious why the browser handles .innerWidth
and .innerWidth()
differently. If I call window.innerWidth()
the console outputs an error saying 'window.innerWidth is not a function.' When I call window.innerWidth
it outputs the pixel width like I expect. But when I call something like $('random_div').innerWidth
it outputs many lines of code, not what I expect. Though, $('random_div').innerWidth()
outputs what I expect.
There is no explanation of the differences in the jQuery documentation that I have found. http://api.jquery.com/innerwidth/
https://jsfiddle.net/cyclingpaper/9fmwjLwq/
Thanks for your time.