title: Remove all the DOM elements with a specific tag name in Javascript
body: <p>How can I remove all the elements with a specific tag name using Javascript. For example, I did the following:</p>
  
  <pre><code>var els = document.getElementsByTagName("center");
  </code></pre>
  
  <p>and it returned an array of all the <code>center</code> elements. How may I remove all these elements?</p>
  
  <p>Coming from <a href="https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript">Remove all child elements of a DOM node in JavaScript</a> and <a href="https://stackoverflow.com/questions/8830839/javascript-dom-remove-element">JavaScript DOM remove element</a> I know that I can loop through <code>els</code>, find the parent of each element and then remove that specific node. But is there anyother way provided by javascript. Like we can do <code>$('center').remove()</code> in jquery and it removes all the elements with <code>center</code> tag. Anything similar to that in Javascript?</p>