how can I insert some HTML code between <div id="mydiv">...</div>
using javascript?
Ex: <div id="mydiv"><span class="prego">Something</span></div>
its about 10 lines of html of most. thank you
If you're replacing the contents of the div and have the HTML as a string you can use the following:
document.getElementById('mydiv').innerHTML = '<span class="prego">Something</span>';
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