November 19th, 2013, 03:20 PM
So I have 'content' that's pulled from .html() of another element and the each-loop above is designed to update the 'name' attribute of all elements within it.
var segment = $(frame).attr('segment');
var num = $(frame).attr('num');
var oldName = $(this).attr('name');
var newName = segment.replace(/^(.*)\]$/,'$1-'+num+']');
This works fine. The first console.log() shows an object in which the 'name' attributes have been correctly replaced.
But the changes don't seem to be committed to the 'content' object--or its descendants, to be more accurate--as revealed by the second console.log().
I swear this was working earlier, but it's not now. And I have no idea why. Am I just overlooking something stupid?
November 19th, 2013, 03:46 PM
Disregard. I seem to have figured it out.