jQuery document.createElement equivalent?

后端 未结 14 1941
暖寄归人
暖寄归人 2020-11-22 05:41

I\'m refactoring some old JavaScript code and there\'s a lot of DOM manipulation going on.

var d = document;
var odv = d.createElement(\"div\");
odv.style.di         


        
14条回答
  •  面向向阳花
    2020-11-22 06:23

    Creating new DOM elements is a core feature of the jQuery() method, see:

    • http://api.jquery.com/jQuery/#creating-new-elements
    • and particulary http://api.jquery.com/jQuery/#example-1-1

提交回复
热议问题