Best way to add DOM elements with jQuery

后端 未结 7 1058
南笙
南笙 2020-12-05 02:08

So I\'ve seen three ways to add html/DOM elements to a page. I\'m curious what the pros and cons are for each of them.

1 - Traditional JavaScript

7条回答
  •  情话喂你
    2020-12-05 02:26

    The cleaner way to do is using jQuery.

    $('tr').addClass('myClass') like syntax. This is easy to read, understand and maintain.

提交回复
热议问题