Ticket #3152 (closed enhancement: invalid)
attr(name, value) does not escape values
|Reported by:||thesaint||Owned by:|
|Keywords:||attributes, attr, escape||Cc:|
If you call the attr(name, value) function to set an attribute value, special characters are not escaped. Quotes and double quotes cause the attribute value to be truncated, ampersands and angle brackets create invalid HTML. To avoid having quoting functions all over the place (think of several plugins that need quoted attributes), I think jQuery should automatically quote special characters when setting attributes (maybe with the option to lave angle brackets and ampersands alone for really exotic uses).