News for hackers. Stuff that matters.
Re:Everything Easy is Hard Again (2018) by grishka on Saturday April 17, 2021 @05:11PM (#26847490)
Here's my "femto-library" for creating DOM dynamically from JS:

    function ce(tag, attrs={}, children=[]){
     var el=document.createElement(tag);
     for(var attrName in attrs){
      el[attrName]=attrs[attrName];
     }
     for(var child of children){
      el.appendChild(child);
     }
     return el;
    };

There are no comments on this comment yet.