Rather than continuing conversation in comments, I will simply post an answer.
Short Answer:
It doesn't matter in the slightest.
Longer Answer:
If by optimization you mean execution time, the difference is irrelevant unless you are creating 1000's of elements. If by optimization you mean good DRY code, then I would say your entire approach is incorrect: use templating instead.
The number of possible methods of templating make enumerating them beyond the scope of this answer, but anything from PHP (if that's how you roll) to Handlebars to custom regex replacements will get the job done. But about the only time I call document.createElement
is for concurrent script bootstrapping that maintains execution order: see this for more details.
So to summarize, use re-usable templates. If the items need to be created dynamically then use client-side rendering. For everything else, use server-side rendering. Avoid manually creating elements as that's pretty low-level, prefer more abstract solutions like the one I suggested.