So the undesirable thing about this solution is that it's doing an additional DOM operation for each attribute. Minimizing DOM operations is the only real performance strategy worth doing for the editor, since they're the only thing slow enough to cause problems. A better solution would be to either build up the HTML as a string, or to do all of the attribute setting before adding the `newNode` to the DOM (so that it's just one, larger, operation).

Every time you change something in the DOM that might possibly have an effect on the way the page is rendered, the browser has to do the work to re-render the entire page. That can be very expensive. By doing the attribute setting before adding the element to the DOM, the browser only needs to do that one time.