Could ```containerClassAttr``` really every be ```undefined```. According to the the documentation (http://api.jquery.com/attr/#attr1) ```$.attr()``` will always return a string.