A few comments:
* Nice idea
* I would only do this in debug mode
* I would definitely not do this by appending an attribute--attributes are very sensitive to what's inside of them.  I'd append a new (hidden) element.