figureElem is already a jQuery object so you don't need to create a second jQuery object. Might be better to use $figureElem so it is clear that it is already a jQuery object.