jquery 创建dom 用的是createElement还是innerHTML?该怎么解决

jquery 创建dom 用的是createElement还是innerHTML?
最近分析了一下js里面innerHTML 和 createElement方式创建dom的效率,与浏览器有关,但总的来说innerHTML更优越一些。
不过我始终没搞清楚jquery到底是用哪种方式把html构造成dom的
eg:$("<div><table></tr..........</div>")

jquery的源码不太好分析,哪位高人能指点一下?

------解决方案--------------------------------------------------------
引用If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag, such as $('<img />') or $('<a></a>'), jQuery creates the element using the native JavaScript createElement() function.

转载:http://www.verydemo.com/demo_c110_i6840.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值