No Description

dom.js 559B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. function createDivWithClassName(className, parent) {
  4. var ele = document.createElement('div');
  5. if (parent) {
  6. parent.appendChild(ele);
  7. }
  8. if (className) {
  9. addClassName(ele, className);
  10. }
  11. return ele;
  12. }
  13. exports.createDivWithClassName = createDivWithClassName;
  14. function addClassName(ele, className) {
  15. if (!ele) {
  16. return;
  17. }
  18. ele.className = ((ele.className || '') + " " + className).trim();
  19. }
  20. exports.addClassName = addClassName;