using $(this).find('class') inside insertAfer code example Example: jquery insert after $( "<p>Test</p>" ).insertAfter( ".inner" );