I'm trying to implement caching and reduced DOM manipulation into my very complex JS code. I just want to make sure, what's more efficient?
1)
var $thebox = $(".textbox[data-title*='"+dt+"']");
$thebox.remove();
or
2) $(".textbox[data-title*='"+dt+"']").remove(); ?
$(".textbox.something']").remove();the most efficient. Searching by attributes is not the fastest.