i tried to use this
$("#aa").insertAfter($("<input type='text' name='category' value='h2' /\>"));
it seems didn't work for me
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");