I’m curious if anyone knows why this piece of jQuery code doesn’t remove the images?
var a = $('#tblMain').clone().remove('img');
The table is being selected. This is trying to take the table on the webpage and export to excel but I do not want the images to export.
Thank you,
Do it like this:
EDIT: Okay, here’s the problem:
http://api.jquery.com/remove/
The
imgin.remove('img')is to filter the set of items in the jquery object, NOT to find elements within the items themselves. In this case, the jquery object contains only one item, the cloned table. Therefore,.remove('img')removes nothing, since the jquery object does not contain any images (only images within items it contains).