Attila Naghi
Attila Naghi

Reputation: 2686

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 ?

Upvotes: 0

Views: 73

Answers (1)

Attila Naghi
Attila Naghi

Reputation: 2686

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

Upvotes: 1

Related Questions