Search code examples
jqueryprototypejsinsertafter

how do i insert html code after a class or id in Prototype js?


Actually I want to insert some html code after an id or class. This is my code:

$$(".validation-advice").each( function (val,i) {
            x = val.innerHTML;
            val.remove();
});

In jQuery would be smth like this $( x ).insertAfter( ".myclass" );, but i don't know what is the equivalent to this in prototype. Can someone help me with this ?


Solution

  • This is the solution: $('myid').insert({after: x});