With the fallowing code I want to delete the last element inside the steps variable,
var steps = $(element).find("fieldset");
var count = steps.size();
steps[count-1] = null;
but when I iterate with the each method, it doesn’t seems to see the null value
steps.each(function(i) {
});
You could use not() to create a new jQuery object removing the elements you don’t want: