Jquery – How to grab the width and height for a currentTarget in jquery


I'm trying to get the width and height of target when I click on it. event.currentTarget.width or event.currentTarget.width() (same for height) is not working. Any ideas on how to obtain the current targets width and height?

Best Solution

If you want to use the jQuery methods you need to wrap the elements, e.g.:


Otherwise you're stuck with using whatever DOM properties your browser supports, e.g..