Skip to main content
your/you're and plural s
Source Link
JJJ
  • 33.2k
  • 20
  • 94
  • 103

The only difference I see is when youryou're using input'sinputs. Some browsers don't recognize that new inputs were added to a form and then, when submitted, don't include those inputs.

When using appendChild this problem does not occur. So, it is a good practice to manipulate DOM and append properly.

If you think it is too much work, create each element and append it, you may consider use some framework to make it faster. jQuery, for example, allows you to use $(parent).html("<p>My dummy text here</p>") and automatically create nodes for you.

The only difference I see is when your using input's. Some browsers don't recognize that new inputs were added to a form and then, when submitted, don't include those inputs.

When using appendChild this problem does not occur. So, it is a good practice to manipulate DOM and append properly.

If you think it is too much work, create each element and append it, you may consider use some framework to make it faster. jQuery, for example, allows you to use $(parent).html("<p>My dummy text here</p>") and automatically create nodes for you.

The only difference I see is when you're using inputs. Some browsers don't recognize that new inputs were added to a form and then, when submitted, don't include those inputs.

When using appendChild this problem does not occur. So, it is a good practice to manipulate DOM and append properly.

If you think it is too much work, create each element and append it, you may consider use some framework to make it faster. jQuery, for example, allows you to use $(parent).html("<p>My dummy text here</p>") and automatically create nodes for you.

Source Link
gustavotkg
  • 4.4k
  • 2
  • 22
  • 29

The only difference I see is when your using input's. Some browsers don't recognize that new inputs were added to a form and then, when submitted, don't include those inputs.

When using appendChild this problem does not occur. So, it is a good practice to manipulate DOM and append properly.

If you think it is too much work, create each element and append it, you may consider use some framework to make it faster. jQuery, for example, allows you to use $(parent).html("<p>My dummy text here</p>") and automatically create nodes for you.