Reputation: 7225
I can delete a single <div>
element by selecting it in Firebug's HTML panel or within the Inspector panel of the Firefox DevTools and pressing Del, but is there a way to delete all elements except one?
Upvotes: 1
Views: 197
Reputation: 749
I don't really see a use case for deleting all HTML elements except one, but there are several ways you could do that in Firefox DevTools:
Doing this however may end up removing a lot of the styling applied to the remaining element, and it may not appear as it originally was after you do this.
Maybe what you want to do instead is "isolate" an element visually in the page so that it's the only one that's visible anymore. If so, there's no feature in devtools to do this, but it's easily achievable by adding some CSS in the Style-Editor panel. Assuming the element you want to isolate has the id "my-id", you could do this:
* { visibility: hidden; } #my-id { visibility: visible; }
Upvotes: 2