Last active
September 27, 2016 01:24
-
-
Save marcusshepp/063bb098661059c30881ddfd27fa83b1 to your computer and use it in GitHub Desktop.
vanilla js get width height
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var element = document.querySelector("#foo"); | |
var element_details = element.getBoundingClientRect(); | |
var element_width = element_details.width; | |
var element_height = element_details.height; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment