I am getting some html and inserting it with .html()
, after which I am trying to get the width of one of newly inserted elements with .width()
(which h
If the element is an image, then the width()
and height()
methods should be accessed on the .load()
jQuery handler;
If the element is a DOM subtree, then they should be accessed on the .ready()
handler.
The reason is that you can't rely on what jQuery reports to be the size of the element until the element has actually been loaded.