How to use jquery after() in javascript?

Asked

Viewed 40 times

1

How do in javascript the same equivalent function in jquery after?

I want to add one div right after the other, so

<div id="div1"></div>
<div id="div2"></div> <!-- div 2 adicionada via javascript após a divi1 -->

In jquery I use this:

$('#div1').after('<div id="div2"></div>');

But I wanted javascript. Someone can help me?

1 answer

2


  • Excellent, thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.