I\'m using jQuery 1.7.0, and I keep getting TypeError: $(...).attr(...) is undefined. Can someone please tell me what the problem is? My jQuery is below. Thank you.
http://api.jquery.com/attr/
As of jQuery 1.6, the .attr() method returns undefined for attributes that have not been set.
My guess is the attribute you are searching for isn't set on the element you're searching for it on. Due to this, .replace is failing because undefined doesn't have a replace method. You'll need to make sure it isn't undefined first.
var current = $(this).attr('rel');
current = current ? current.replace('aboutitemremove_', '') : '';
do this for the id in the next area too.