jQuery - Best Practice for creating complex HTML Fragments

后端 未结 9 1473
情深已故
情深已故 2021-01-30 03:21

Is there a general best practice for creating somewhat complex HTML elements in jQuery? I\'ve tried a few different ways.

First I tried using createElement and chaining

9条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 03:51

    I personally think that it's more important for the code to be readable and editable than performant. Whichever one you find easier to look at and make changes to without breaking it should be the one you choose.

提交回复
热议问题