Is it possible to prepend after a certain element? For example, I am prepending a hyperlink to a div however there is already an element in there represented as <a id="test">test1</a> Is it possible to prepend the test2 hyperlink after the test1 hyperlink?
$('div[id='+id+']').prepend('<a id="test">test2</a>');
You can use
.after()to place it after the other element, like this: