Here I’m wrapping an HTML tag with another tag ‘$holder’ below.
$holder = $('<div />')
.addClass('joverlaytext')
.css({
position:'relative',
});
$(this).wrap($holder);
Now after this statment how to get the object/reference to this newly created HTML element, ie. jQuery obj of ‘$holder’
Just continue the chain, e.g.:
If you look at the manipulation methods documentation, .wrap(elem) returns a jQuery object, so chaining or
will work.