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.
First difference:

```
.removeAttr('name')  // try to remove the attribute 'name' from the DOM
.attr('name', '')    // set the attribute 'name' to empty string

```

The second difference, probably happened only to me, is `.removeAttr()` work correctly in Firefox and IExplorer but not very well in Chrome and don't work at all on Safari.