Reputation: 14691
i tried to use this
$("#aa").insertAfter($("<input type='text' name='category' value='h2' /\>"));
it seems didn't work for me
Upvotes: 1
Views: 122
Reputation: 630389
You want to use .after()
here, like this:
$("#aa").after("<input type='text' name='category' value='h2' /\>");
.insertAfter()
is the opposite, it takes the first element and tries to place it after the second element (or selector, whichever you give it), so it would look like this:
$("<input type='text' name='category' value='h2' /\>").insertAfter("#aa");
Upvotes: 3