Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add an element after another element?

People also ask

Which is the correct syntax to insert content after the div elements?

The jQuery after() method is used to insert content after the selected elements.


try using the after() method:

$('#bla').after('<div id="space"></div>');

Documentation


try

.insertAfter()

here

$(content).insertAfter('#bla');

First of all, input element shouldn't have a closing tag (from http://www.w3.org/TR/html401/interact/forms.html#edef-INPUT : End tag: forbidden ).

Second thing, you need the after(), not append() function.