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

html - Difficulties with background-image property -

ios - Segue not passing data between ViewControllers -

visual studio code - What does the isShellCommand property actually do and how should you use it? -