jquery add href attribute before div and end after div code example Example: insertafter $( "<p>Test</p>" ).insertAfter( ".inner" );