6 ms·
to reduce dom transversal you should assign selectors to variables. var tipBtn = $(".tip_btn"); then anytime you use tipBtn it has a saved reference to the d
by codedestroyer 7y ago
to reduce dom transversal you should assign selectors to variables.
var tipBtn = $(".tip_btn");
then anytime you use tipBtn it has a saved reference to the dom node, if you repeat selectors they recalculate each use.
- chickenmonkey 7y agoThat's helpful. Thanks!