dynamic-removal.js 391 B

123456789101112131415
  1. function getElements(className) {
  2. return Array.from(document.getElementsByClassName(className));
  3. }
  4. window.onload = function() {
  5. // Force a reflow before any changes.
  6. document.body.clientWidth;
  7. getElements('remove').forEach(function(e) {
  8. e.parentNode.removeChild(e);
  9. });
  10. getElements('remove-after').forEach(function(e) {
  11. e.parentNode.removeChild(e.nextSibling);
  12. });
  13. };