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?
If you want to use the jQuery methods you need to wrap the elements, e.g.:
$(event.currentTarget).width()
Otherwise you're stuck with using whatever DOM properties your browser supports, e.g..
event.currentTarget.offsetWidth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With