javascript - Jquery - get selector when using after -


i have code:

$('#.element').on('click', function(e) {     $(this).after('<div>...</div>'); }); 

and want other stuff created div in same line of code without using id. how can that?

i mean this:

$(this).after('<div>...</div>').css('border', '1px').fadeout('5000'); 

this above code set border , fadeout element $(this), want done new created div element.

this why .insertafter() have been introduced, return objects in reverse manner.

$('<div>...</div>').css('border', '1px').insertafter($(this)).fadeout('5000'); 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -