I am doing a class exercise.
I have to create an onclick function that remove the elements
that are inside the form
<div id="content">
<form id="form">
<p>Hola</p>
<p>que</p>
<p>tal</p>
</form>
</div>
I need to remove the p elements with js.
I was doing something like this, but tbh I do not know how to do it
document.getElementById('form').appendChild("");
Thank you in advance :)
document.getElementById('form').innerHTML = '';instead. The innerHTML attribute get and set the inner html of the element as a string.