How do I do this in dart?
After grabbing a tbody element, I would like to do call empty() on it, but that does not seem to exist:
var el = query('#search_results_tbody');
el.empty();
I tried this, but it is acting weird, I dont even understand what the result is!
el.nodes.forEach((c) {c.remove();});
I believe the fastest and easiest way to do this at the moment is simply set the contents to empty:
innerHtmlis pretty optimized these days on the browser, it should be quick.Alternatively, you could also do this:
Where
childrenis aList<Element>with aclear()method to clear the list.