To remove an element, use removeChild(). To create new elements you need to use createElement(). To apply attributes, use setAttribute(). To set the element in place, use appendChild();


<script...