Question: Is there generally a difference between `removeAttr(x)` and `attr(x, '')` in jQuery? 

If so, when to use each one?

Answer: 
They are quite different operations:

**attr(x, '')** sets an attribute to an empty string

**removeAttr(x)** deletes the property on the object if possible, or removes it and resets it to its default value if it is defined by the DTD for that object class.
`.removeAttr(x);` is equivalent to `.removeAttribute("x");` while `.attr(x, '')` simply sets `.x` to an empty string. See the [jQuery `removeAttr` ref](http://api.jquery.com/removeAttr/) and the corresponding [mozilla `removeAttribute` ref](https://developer.mozilla.org/en/DOM/element.removeAttribute) for more info.