Aquí está un ejemplo simple para ilustrar el comportamiento:
Dada esta html marcado:
<div data-company="Microsoft"></div>
y este código jQuery (usando jQuery 1.5.1):
// read the data
alert($("div").data("company"));
// returns Microsoft <<< OK!
// set the data
$("div").data("company","Apple");
alert($("div").data("company"));
// returns Apple <<< OK!
// attribute selector
alert($("div[data-company='Apple']").length);
// returns 0 <<< WHY???
// attribute selector again
alert($("div[data-company='Microsoft']").length);
// returns 1 <<< WHY???
// set the attribute directly
$("div").attr("data-company","Apple");
alert($("div[data-company='Apple']").length);
// now returns 1 <<< OK!
Desde jQuery importa automáticamente los datos HTML5- * en el objeto de datos de jQuery, ¿no deberían actualizarse los atributos también cuando cambian los datos?
@James '" div [data-company = 'Apple' "' - se olvidó de cerrar con ']' –