I have the following javascript:
// create a new article tag
var elem = document.createElement(\'article\');
// append the article to the comments list
docu
According to the OP questions, its comments, and the one good answer, in this instance you are better off using elem.outerHTML
because you are/can pre-parse your input in Rails.
If you were to move decision making to the JavaScript side, good coding practice would dictate creating all nodes by hand. If you are processing 100's of element inserts then you will notice a difference in speed (if you were to benchtest both solutions).