append() outside or prependTo().next() ?
Assume the following html code:
- <table class="foobar">...</table>
- <script>....</script>
- <script>....</script>
- <script>....</script>
- <p>.....</p>
Now I want to insert some stuff AFTER table which can be identified by its class.
The two methods I considered do not work:
1. $(".foobar").append("......");
appends something INSIDE the <table>...</table> element but I want it outside
2. $("......").prependTo($(".foobar").next());
does not work either. a pre-grouping of $(".foobar").next() in an enclosing bracket is not correctly recognized.
Or the stuff is inserted into <script> element. But I want it in the next VISIBLE element
Is there another solution?