I have a jQuery object that is created through jQuery .find()as shown below ...
var $mytable= $('#mytable');
var $myObject = $mytable.find("tbody tr");
This works fine and creates a jQuery object of all the elements trin tbody. However, as I iterate over the data, I need to delete parts of the object when I go. For example, if the above call returns a jQuery object with a name of $myObjectlength 10, and I want to remove index 10, I thought I could just do $myObject.splice(10,1)it and it will delete the element with index 10. However, this does not seem to work.
Any ideas why? Thanks!
UPDATE
Basically I just want to remove any element that I want from $ myObject when I go through the data. I know this is based on level zero (a bad example higher than I assume), just trying to understand my point of view.
UPDATE
Ok, so I create an object using the find method in the table, and when I create it, the length is 24. When I iterate over the object, when I hit the element, I don’t want me to try to use Array.prototype.splice.call ($ rows, x, 1), where x represents the index to delete. Subsequently, when I view the object in the console, it still has a length of 24.
source
share