component / dom

DOM traversal, manipulation and events aggregate library (like jQuery)
228 stars 49 forks source link

Add .empty #20

Closed vendethiel closed 11 years ago

vendethiel commented 11 years ago

I think we can import some more methods (allow .html() to set innerHTML, for example) and I can do a bigger PR if you want. Maybe use component/css ?

vendethiel commented 11 years ago

@visionmedia I used removeChild() because that's what jquery is doing. I have no idea why OTTOMH, do you ?

tj commented 11 years ago

weird maybe it is faster then (havent benched, too early for that), sounds good then!

vendethiel commented 11 years ago

actually this one was the ok one - no need for the other pr since you did it yourself

tj commented 11 years ago

yup this is all good, just needs a rebase

vendethiel commented 11 years ago

Voilà, the conflict was on readme

vendethiel commented 11 years ago

thanks!

vendethiel commented 11 years ago

weird maybe it is faster then (havent benched, too early for that), sounds good then!

Definitely faster.

http://jsperf.com/emptify-element/2 innerHTML = null : 1,890Ops firstChild.remove() : 61,250,827Ops