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:
$('#test').after('<a id="test2">test2</a>');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With